]> git.decadent.org.uk Git - videolink.git/blobdiff - auto_proc.cpp
Release versions 1.2.11 and 1.2.11-1
[videolink.git] / auto_proc.cpp
index 1e7d70c31d12820795e69337d9c5abb1b8086b17..06abfad3b454dd11b084e129890511413352e242 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
+// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
 // See the file "COPYING" for licence details.
 
 #include <cassert>
@@ -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