summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-16 16:25:59 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-16 16:25:59 +0200
commitcb9d7370302cb0ffc0c750e928f5413089cbca4c (patch)
tree8b3905bc46cf013d3e84f6b8fb63a2abe5c102ee /main.c
parent2f976c53919e49b9008e9d5f23349be3c992e87b (diff)
fix infinite loop in logging when the logged process dies
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index 02fd9ff..b17f053 100644
--- a/main.c
+++ b/main.c
@@ -98,7 +98,7 @@ retry:
if (errno == EINTR)
goto retry;
- return;
+ goto out;
}
proc->log_buf_ofs += len;
@@ -134,6 +134,10 @@ retry:
if (read_len == maxlen)
goto retry;
+
+out:
+ if (fd->eof)
+ uloop_fd_delete(fd);
}
static void