From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com ([209.85.215.67]:45505 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbeBTTkR (ORCPT ); Tue, 20 Feb 2018 14:40:17 -0500 Received: by mail-lf0-f67.google.com with SMTP id x196so5829916lfd.12 for ; Tue, 20 Feb 2018 11:40:17 -0800 (PST) From: Serhey Popovych To: netdev@vger.kernel.org Cc: dsahern@gmail.com Subject: [PATCH iproute2-next 1/8] iplink: Return from function instead of calling exit() Date: Tue, 20 Feb 2018 21:39:51 +0200 Message-Id: <1519155598-22137-2-git-send-email-serhe.popovych@gmail.com> In-Reply-To: <1519155598-22137-1-git-send-email-serhe.popovych@gmail.com> References: <1519155598-22137-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Signed-off-by: Serhey Popovych --- ip/iplink.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index 74c377c..a2c8108 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -653,7 +653,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, NEXT_ARG(); if (xdp_parse(&argc, &argv, req, dev_index, generic, drv, offload)) - exit(-1); + return -1; } else if (strcmp(*argv, "netns") == 0) { NEXT_ARG(); if (netns != -1) @@ -972,12 +972,12 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv) if (!dev) { fprintf(stderr, "Not enough information: \"dev\" argument is required.\n"); - exit(-1); + return -1; } if (cmd == RTM_NEWLINK && index) { fprintf(stderr, "index can be used only when creating devices.\n"); - exit(-1); + return -1; } req.i.ifi_index = ll_name_to_index(dev); @@ -1392,7 +1392,7 @@ static int do_set(int argc, char **argv) if (!dev) { fprintf(stderr, "Not enough of information: \"dev\" argument is required.\n"); - exit(-1); + return -1; } if (newaddr || newbrd) { @@ -1553,7 +1553,7 @@ static int iplink_afstats(int argc, char **argv) fprintf(stderr, "Command \"%s\" is unknown, try \"ip link help\".\n", *argv); - exit(-1); + return -1; } argv++; argc--; @@ -1648,5 +1648,5 @@ int do_iplink(int argc, char **argv) fprintf(stderr, "Command \"%s\" is unknown, try \"ip link help\".\n", *argv); - exit(-1); + return -1; } -- 1.7.10.4