aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Thelen <gthelen@google.com>2011-11-30 15:53:23 -0800
committermaximilian attems <max@stro.at>2011-12-04 14:43:43 +0100
commit1c3e2f3c152ef2a55d47b7149c85f167fabd8f2f (patch)
tree5ab6f4ddd38c08ce67c9bb285ce711415ea061a6
parent7f47891c1678874cccca66cd25e6a13486c86d78 (diff)
downloadklibc-1c3e2f3c152ef2a55d47b7149c85f167fabd8f2f.tar.gz
[klibc] ipconfig: check poll() return value
Check the poll() return value for error before inspecting its output. Signed-off-by: Greg Thelen <gthelen@google.com> Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/kinit/ipconfig/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
index 8782ae7feb64d..37ca5734e6207 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -408,7 +408,7 @@ static int loop(void)
prev = now;
gettimeofday(&now, NULL);
- if ((fds[0].revents & POLLRDNORM)) {
+ if ((nr > 0) && (fds[0].revents & POLLRDNORM)) {
if (do_pkt_recv(pkt_fd, now.tv_sec) == 1)
break;
}