]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
spawn: fix spawn_reaper - handle errors
authorJaroslav Kysela <perex@perex.cz>
Thu, 23 Apr 2015 12:47:16 +0000 (14:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 23 Apr 2015 12:47:16 +0000 (14:47 +0200)
src/spawn.c

index 7c2b4710045105182445776bfb10cdcfc6e4c22e..51ebd997abf4f2efcc2249d3dbad4df26ea7ada4 100644 (file)
@@ -283,7 +283,15 @@ spawn_reap(pid_t wpid, char *stxt, size_t stxtlen)
 static void
 spawn_reaper(void)
 {
-  while (spawn_reap(-1, NULL, 0) != -EAGAIN) ;
+  int r;
+
+  do {
+    r = spawn_reap(-1, NULL, 0);
+    if (r == -EAGAIN)
+      continue;
+    if (r < 0)
+      break;
+  } while (1);
 }
 
 /**