File ip-fix-exit-code-for-rule-failures.patch of Package iproute2
From: Stephen Hemminger <shemming@brocade.com>
Date: Wed, 6 May 2015 09:53:41 -0700
Subject: ip: fix exit code for rule failures
Patch-mainline: v4.1.0
Git-commit: 076ae7089a4b4874a1aedd4c5f84bb889dcda34e
References: bsc#949040
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.
Acked-by: Michal Kubecek <mkubecek@suse.cz>
---
ip/iprule.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iprule.c b/ip/iprule.c
index d934f67da2e6..2c32eea9345c 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -388,7 +388,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;
}
--
2.6.1