]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip route get: change exit to return to support batch commands
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Thu, 15 Oct 2015 22:23:50 +0000 (15:23 -0700)
committerStephen Hemminger <shemming@brocade.com>
Mon, 19 Oct 2015 04:57:46 +0000 (21:57 -0700)
replace exit with return -2 on rtnl_talk failure

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

index da25548c5464b6ea7d5c7a856d49e20b4930ea79..b137f555de0e76c8628a9b7ed36c755cfe66e997 100644 (file)
@@ -1643,7 +1643,7 @@ static int iproute_get(int argc, char **argv)
                req.r.rtm_family = AF_INET;
 
        if (rtnl_talk(&rth, &req.n, &req.n, sizeof(req)) < 0)
-               exit(2);
+               return -2;
 
        if (connected && !from_ok) {
                struct rtmsg *r = NLMSG_DATA(&req.n);