From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 5/8] Move ENOENT error message into conf_ns_opt() Date: Fri, 26 Aug 2022 14:58:36 +1000 Message-ID: <20220826045839.1112152-6-david@gibson.dropbear.id.au> In-Reply-To: <20220826045839.1112152-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3520616696920302076==" --===============3520616696920302076== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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(-) diff --git a/conf.c b/conf.c index e76181c..47f3e41 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; } @@ -1446,8 +1447,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) { -- 2.37.2 --===============3520616696920302076==--