Subject: Re: [patch] [iproute] ip exit, ip and tc line number

From: Michele Petrazzo - Unipex <[email-masked]>
Date: Sat, 06 Mar 2010 19:56:53 +0100

Stephen Hemminger wrote:
> The force issue is a different problem so please split out that part
> and resubmit.

Attached.

Michele
commit b1875eb9564da302ba79c01746ec9cf391d0d593
Author: Michele Petrazzo <[email-masked]>
Date:   Sat Mar 6 19:45:27 2010 +0100

    Allow ip to process all the file passed with the -batch argument when
    is passed also the -force switch

    Signed-off-by: Michele Petrazzo <[email-masked]>

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index e9256d9..8ec6cfd 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1014,7 +1014,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
 	}
 	if (l && matches(d, l) != 0) {
 		fprintf(stderr, "\"dev\" (%s) must match \"label\" (%s).\n", d, l);
-		exit(1);
+		return -1;
 	}
 
 	if (peer_len == 0 && local_len) {
@@ -1079,7 +1079,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
 	}
 
 	if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
-		exit(2);
+		return -2;
 
 	return 0;
 }