* [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error.
@ 2016-11-11 18:55 David Decotigny
2016-11-11 18:55 ` [PATCH iproute2 v1 2/2] iproute2: a non-expected rtnl message is an error David Decotigny
2016-11-29 20:46 ` [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: David Decotigny @ 2016-11-11 18:55 UTC (permalink / raw)
To: Stephen Hemminger, Alexey Kuznetsov; +Cc: netdev, David Decotigny
Be consistent with how non-0 print_route() return values are handled
elesewhere: return -1.
---
ip/iproute.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 98bfad6..dae793b 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1743,7 +1743,7 @@ static int iproute_get(int argc, char **argv)
if (print_route(NULL, &req.n, (void *)stdout) < 0) {
fprintf(stderr, "An error :-)\n");
- exit(1);
+ return -1;
}
if (req.n.nlmsg_type != RTM_NEWROUTE) {
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH iproute2 v1 2/2] iproute2: a non-expected rtnl message is an error
2016-11-11 18:55 [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error David Decotigny
@ 2016-11-11 18:55 ` David Decotigny
2016-11-29 20:46 ` [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: David Decotigny @ 2016-11-11 18:55 UTC (permalink / raw)
To: Stephen Hemminger, Alexey Kuznetsov; +Cc: netdev, David Decotigny
---
ip/iproute.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index dae793b..10d0afe 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -320,7 +320,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
fprintf(stderr, "Not a route: %08x %08x %08x\n",
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
- return 0;
+ return -1;
}
if (filter.flushb && n->nlmsg_type != RTM_NEWROUTE)
return 0;
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error.
2016-11-11 18:55 [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error David Decotigny
2016-11-11 18:55 ` [PATCH iproute2 v1 2/2] iproute2: a non-expected rtnl message is an error David Decotigny
@ 2016-11-29 20:46 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2016-11-29 20:46 UTC (permalink / raw)
To: David Decotigny; +Cc: Alexey Kuznetsov, netdev
On Fri, 11 Nov 2016 10:55:36 -0800
David Decotigny <ddecotig@gmail.com> wrote:
> Be consistent with how non-0 print_route() return values are handled
> elesewhere: return -1.
>
>
> ---
> ip/iproute.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, and queued for next push.
Please use Signed-off-by: on future patches.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-29 20:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 18:55 [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error David Decotigny
2016-11-11 18:55 ` [PATCH iproute2 v1 2/2] iproute2: a non-expected rtnl message is an error David Decotigny
2016-11-29 20:46 ` [PATCH iproute2 v1 1/2] iproute2: avoid exit in case of error Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).