mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] net: dhcp: Fix return value on ctrl-c
Date: Tue, 14 May 2013 11:58:16 +0200	[thread overview]
Message-ID: <1368525497-4413-1-git-send-email-s.hauer@pengutronix.de> (raw)

the dhcp command will return with 0 when ctrl-c is pressed. Fix this to
-EINTR instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 net/dhcp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/dhcp.c b/net/dhcp.c
index 8233ec3..7324c94 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -767,8 +767,10 @@ static int do_dhcp(int argc, char *argv[])
 		goto out1;
 
 	while (dhcp_state != BOUND) {
-		if (ctrlc())
-			break;
+		if (ctrlc()) {
+			ret = -EINTR;
+			goto out1;
+		}
 		if (!retries) {
 			ret = -ETIMEDOUT;
 			goto out1;
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2013-05-14  9:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14  9:58 Sascha Hauer [this message]
2013-05-14  9:58 ` [PATCH 2/2] net: dhcp: Fix tftp servername handling Sascha Hauer

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=1368525497-4413-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox