]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: fix exit code for addrlabel
authorStephen Hemminger <shemming@brocade.com>
Wed, 6 May 2015 16:55:07 +0000 (09:55 -0700)
committerStephen Hemminger <shemming@brocade.com>
Thu, 7 May 2015 15:11:30 +0000 (08:11 -0700)
The exit code for ip label was not correct.
The return from the command function is negated and turned into
the exit code on failure.

ip/ipaddrlabel.c

index f6a638b5a07ca8eef758d2148a601b8ae677a97b..19a93083a45df28eefbabc66e2f66ee5069203cc 100644 (file)
@@ -183,7 +183,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
                req.ifal.ifal_family = AF_INET6;
 
        if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
-               return 2;
+               return -2;
 
        return 0;
 }
@@ -232,12 +232,12 @@ static int ipaddrlabel_flush(int argc, char **argv)
 
        if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
                perror("Cannot send dump request");
-               return 1;
+               return -1;
        }
 
        if (rtnl_dump_filter(&rth, flush_addrlabel, NULL) < 0) {
                fprintf(stderr, "Flush terminated\n");
-               return 1;
+               return -1;
        }
 
        return 0;