]> git.decadent.org.uk Git - videolink.git/commitdiff
Changed auto_kill_proc_closer to wait for the process to exit after killing it.
authorBen Hutchings <ben@decadent.org.uk>
Fri, 9 Dec 2005 00:45:24 +0000 (00:45 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 23:19:47 +0000 (23:19 +0000)
auto_proc.cpp

index 1e7d70c31d12820795e69337d9c5abb1b8086b17..ad04a125f25a9001a7d9288e5d861ff9f2bd5143 100644 (file)
@@ -15,7 +15,15 @@ void auto_kill_proc_closer::operator()(pid_t pid) const
     assert(pid >= -1);
 
     if (pid > 0 && waitpid(pid, NULL, WNOHANG) == 0)
+    {
        kill(pid, SIGTERM);
+       while (waitpid(pid, NULL, 0) == -1)
+           if (errno != EINTR)
+           {
+               assert(!"invalid pid in auto_kill_proc_closer");
+               break;
+           }
+    }
 }
 
 void auto_wait_proc_closer::operator()(pid_t pid) const