From 70389d364089f7e9f132f712f6b2d6ab2b129453 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 26 Aug 2022 14:58:36 +1000 Subject: Move ENOENT error message into conf_ns_opt() After calling conf_ns_opt() we check for -ENOENT and print an error message, but conf_ns_opt() prints messages for other errors itself. For consistency move the ENOENT message into conf_ns_opt() as well. Signed-off-by: David Gibson --- conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 10d4ae8..c9edb70 100644 --- a/conf.c +++ b/conf.c @@ -602,6 +602,7 @@ static int conf_ns_opt(struct ctx *c, c->netns_only = netns_only_reset; + err("Namespace %s not found", optarg); return -ENOENT; } @@ -1464,8 +1465,6 @@ void conf(struct ctx *c, int argc, char **argv) if (c->mode == MODE_PASTA && optind + 1 == argc) { ret = conf_ns_opt(c, userns, argv[optind]); - if (ret == -ENOENT) - err("Namespace %s not found", argv[optind]); if (ret < 0) usage(argv[0]); } else if (c->mode == MODE_PASTA && *userns && optind == argc) { -- cgit v1.2.3