]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
config: fix wait for backup completeness
authorJaroslav Kysela <perex@perex.cz>
Sat, 20 Jun 2015 09:31:15 +0000 (11:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 20 Jun 2015 09:31:39 +0000 (11:31 +0200)
src/config.c
src/spawn.c

index 71e9ab0eee9e5ce8cc9a56ada2db7f07914d3912..10d20646ad203ec2996c825398312217d0d22a8f 100644 (file)
@@ -1243,6 +1243,7 @@ dobackup(const char *oldver)
       usleep(20000);
     if (code == -ECHILD)
       code = 0;
+    tvhinfo("config", "backup: completed");
   }
 
   if (code) {
index 18ee0ba3acbed9917d468d631382afa57d5ad016..f311061932f15778156712090d39dc727db6522c 100644 (file)
@@ -241,8 +241,11 @@ spawn_reap(pid_t wpid, char *stxt, size_t stxtlen)
     return -EAGAIN;
   if(pid < 0)
     return -errno;
-  if(pid < 1)
+  if(pid < 1) {
+    if (wpid > 0 && pid != wpid)
+      return -EAGAIN;
     return 0;
+  }
 
   pthread_mutex_lock(&spawn_mutex);
   LIST_FOREACH(s, &spawns, link)