From: roopa <roopa@cumulusnetworks.com>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: stephen@networkplumber.org, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] ip route get: change exit to return to support batch commands
Date: Thu, 15 Oct 2015 20:13:23 -0700 [thread overview]
Message-ID: <56206B53.1080709@cumulusnetworks.com> (raw)
In-Reply-To: <56206314.6020601@cumulusnetworks.com>
On 10/15/15, 7:38 PM, David Ahern wrote:
> Hi Roopa:
>
> On 10/15/15 4:23 PM, Roopa Prabhu wrote:
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> replace exit with return -2 on rtnl_talk failure
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>> ip/iproute.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ip/iproute.c b/ip/iproute.c
>> index da25548..b137f55 100644
>> --- a/ip/iproute.c
>> +++ b/ip/iproute.c
>> @@ -1643,7 +1643,7 @@ static int iproute_get(int argc, char **argv)
>> req.r.rtm_family = AF_INET;
>>
>> if (rtnl_talk(&rth, &req.n, &req.n, sizeof(req)) < 0)
>> - exit(2);
>> + return -2;
>>
>> if (connected && !from_ok) {
>> struct rtmsg *r = NLMSG_DATA(&req.n);
>>
>
> Why return -2 vs exit(2)? What does the change mean to a user or the functionality of ip?
Stephen has documented this someplace. I have seen it before. I now forget where. Right now i am just following
the rest of the code.
next prev parent reply other threads:[~2015-10-16 3:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 22:23 [PATCH iproute2] ip route get: change exit to return to support batch commands Roopa Prabhu
2015-10-16 2:38 ` David Ahern
2015-10-16 3:13 ` roopa [this message]
2015-10-16 6:08 ` Vadim Kochan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56206B53.1080709@cumulusnetworks.com \
--to=roopa@cumulusnetworks.com \
--cc=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.