summaryrefslogtreecommitdiff
path: root/net/dhcp.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-14 11:50:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-14 11:50:18 +0200
commit37b0cce64dc07c8c266bd2ef4613e0c9069e8aaa (patch)
treefb401d228fb958f300fa73c50ec7815e91c79ed1 /net/dhcp.c
parent2924294da12565f982e33e942721f5cedac893d5 (diff)
downloadbarebox-37b0cce64dc07c8c266bd2ef4613e0c9069e8aaa.tar.gz
net: dhcp: Fix return value on ctrl-c
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>
Diffstat (limited to 'net/dhcp.c')
-rw-r--r--net/dhcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dhcp.c b/net/dhcp.c
index 8233ec3502..7324c94838 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;