uloop: retry waitpid on signal interrupt
authorFelix Fietkau <nbd@nbd.name>
Tue, 17 May 2016 11:27:44 +0000 (13:27 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 17 May 2016 11:27:44 +0000 (13:27 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
uloop.c

diff --git a/uloop.c b/uloop.c
index 6ef7210fae375cba63b28e6f6d7ca0b0b444f126..45f7c5d83858673885a1c602a6aa9ff189da8cdf 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -311,6 +311,9 @@ static void uloop_handle_processes(void)
 
        while (1) {
                pid = waitpid(-1, &ret, WNOHANG);
+               if (pid < 0 && errno == EINTR)
+                       continue;
+
                if (pid <= 0)
                        return;