Explorar el Código

jail: remove unreachable code

Replace unreachable error handling code in function setns_open with
a more appropriate assertion.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle hace 3 años
padre
commit
111416d10b
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      jail/jail.c

+ 1 - 2
jail/jail.c

@@ -1008,8 +1008,7 @@ static int setns_open(unsigned long nstype)
 {
 	int *fd = get_namespace_fd(nstype);
 
-	if (!*fd)
-		return EFAULT;
+	assert(fd != NULL);
 
 	if (*fd == -1)
 		return 0;