]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
nsenter: drop core when impossible happens
authorSami Kerola <kerolasa@iki.fi>
Sun, 20 Jan 2013 18:04:55 +0000 (18:04 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 25 Jan 2013 14:41:00 +0000 (15:41 +0100)
Message to user is less informative, but impossible events should be
rare so core files are much appriciated for these cases.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/nsenter.c

index bb0c561441e3c0b2c61b2c28ed44662271842370..7c9276f12c7cadb4a1983fbe936e1fdd5eb49fa8 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <unistd.h>
+#include <assert.h>
 
 #include "strutils.h"
 #include "nls.h"
@@ -118,7 +119,7 @@ static void open_namespace_fd(int nstype, const char *path)
                return;
        }
        /* This should never happen */
-       err(EXIT_FAILURE, "Unrecognized namespace type");
+       assert(nsfile->nstype);
 }
 
 static void continue_as_child(void)