public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 5/6] nsenter: drop core when impossible happens
Date: Sun, 20 Jan 2013 18:04:55 +0000	[thread overview]
Message-ID: <1358705096-21092-6-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1358705096-21092-1-git-send-email-kerolasa@iki.fi>

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


  parent reply	other threads:[~2013-01-20 18:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 18:04 [PATCH 0/6] pull: nsenter: trivial adjustments Sami Kerola
2013-01-20 18:04 ` [PATCH 1/6] docs: align nsenter.1 man page with howto-man-page.txt Sami Kerola
2013-01-20 18:04 ` [PATCH 2/6] build-sys: add nsenter to gitignore Sami Kerola
2013-01-20 18:04 ` [PATCH 3/6] nsenter: adjust few error messages Sami Kerola
2013-01-20 18:04 ` [PATCH 4/6] nsenter: fix compiler warning Sami Kerola
2013-01-20 18:04 ` Sami Kerola [this message]
2013-01-20 18:04 ` [PATCH 6/6] nsenter: fix indentation Sami Kerola
2013-01-25 14:52 ` [PATCH 0/6] pull: nsenter: trivial adjustments Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358705096-21092-6-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox