netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] iplink: replace exit with return
@ 2016-01-10  0:02 Roopa Prabhu
  2016-01-11 16:27 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Roopa Prabhu @ 2016-01-10  0:02 UTC (permalink / raw)
  To: stephen; +Cc: netdev

From: Roopa Prabhu <roopa@cumulusnetworks.com>

This patch replaces exits with returns in iplink
command. Helps to continue on errors when
invoked with ip -force -batch.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
 ip/iplink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index f30de86..c706d20 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -710,7 +710,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 			req.i.ifi_index = 0;
 			addattr32(&req.n, sizeof(req), IFLA_GROUP, group);
 			if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
-				exit(2);
+				return -2;
 			return 0;
 		}
 	}
@@ -809,7 +809,7 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 	}
 
 	if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
-		exit(2);
+		return -2;
 
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] iplink: replace exit with return
  2016-01-10  0:02 [PATCH iproute2] iplink: replace exit with return Roopa Prabhu
@ 2016-01-11 16:27 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2016-01-11 16:27 UTC (permalink / raw)
  To: Roopa Prabhu; +Cc: netdev

On Sat,  9 Jan 2016 16:02:12 -0800
Roopa Prabhu <roopa@cumulusnetworks.com> wrote:

> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> 
> This patch replaces exits with returns in iplink
> command. Helps to continue on errors when
> invoked with ip -force -batch.
> 
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Applied thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-11 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-10  0:02 [PATCH iproute2] iplink: replace exit with return Roopa Prabhu
2016-01-11 16:27 ` 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).