Patchwork [iproute2-3.8,3/6] iproute2: Improve "ip netns add" failure error message

login
register
mail settings
Submitter Eric W. Biederman
Date Jan. 18, 2013, 12:46 a.m.
Message ID <87obgn48ss.fsf_-_@xmission.com>
Download mbox | patch
Permalink /patch/213417/
State Accepted
Delegated to: stephen hemminger
Headers show

Comments

Eric W. Biederman - Jan. 18, 2013, 12:46 a.m.
Report the name of the network namespace that could not be
added.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 ip/ipnetns.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index ae55090..4fce379 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -135,8 +135,8 @@  static int netns_exec(int argc, char **argv)
 	snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
 	netns = open(net_path, O_RDONLY);
 	if (netns < 0) {
-		fprintf(stderr, "Cannot open network namespace: %s\n",
-			strerror(errno));
+		fprintf(stderr, "Cannot open network namespace %s: %s\n",
+			name, strerror(errno));
 		return EXIT_FAILURE;
 	}
 	if (setns(netns, CLONE_NEWNET) < 0) {