]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iplink: replace exit with return
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Sun, 10 Jan 2016 00:02:12 +0000 (16:02 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 11 Jan 2016 16:23:27 +0000 (08:23 -0800)
This patch replaces exits with returns in iplink
command. Helps to continue on errors when
invoked with ip -force -batch.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
ip/iplink.c

index f30de86d1858a013b5ab8b9fd65bf61dd7a5a3ce..c706d2089dcb2a86e3c5a9f3f4f0f1ac2f13f412 100644 (file)
@@ -710,7 +710,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
                        req.i.ifi_index = 0;
                        addattr32(&req.n, sizeof(req), IFLA_GROUP, group);
                        if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
-                               exit(2);
+                               return -2;
                        return 0;
                }
        }
@@ -809,7 +809,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
        }
 
        if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
-               exit(2);
+               return -2;
 
        return 0;
 }