From: Stephen Hemminger Date: Wed, 6 May 2015 16:53:41 +0000 (-0700) Subject: ip: fix exit code for rule failures X-Git-Tag: v4.1.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=076ae7089a4b4874a1aedd4c5f84bb889dcda34e;p=thirdparty%2Fiproute2.git ip: fix exit code for rule failures If ip rule command fails talking to kernel, exit code should be 2. The sub-command is called by cmd loop and the exit code is negative of return value from the command callback. --- diff --git a/ip/iprule.c b/ip/iprule.c index 967969c0e..986a5bcba 100644 --- a/ip/iprule.c +++ b/ip/iprule.c @@ -381,7 +381,7 @@ static int iprule_modify(int cmd, int argc, char **argv) req.r.rtm_table = RT_TABLE_MAIN; if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0) - return 2; + return -2; return 0; }