[PATCH 5/6] nsenter: drop core when impossible happens

Sami Kerola
2013-01-20T18:05:15Z

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 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c
index b83f457..0e1c8f4 100644
--- a/sys-utils/nsenter.c
+++ b/sys-utils/nsenter.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <assert.h>

#include "strutils.h"
#include "nls.h"
@@ -117,7 +118,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)
--
1.8.1.1