]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Daniel Drown discovered we were not cleaning up killed pipe backends, leaving zombies...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 26 Nov 2008 19:58:48 +0000 (19:58 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 26 Nov 2008 19:58:48 +0000 (19:58 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1307 d19b8d6e-7fed-0310-83ef-9ca221ded41b

modules/pipebackend/coprocess.cc

index f8e94aaf7240dce3f73eed99fc11349be389c186..fff84f35a37d780ffcdfd89be967723ffafcb12d 100644 (file)
@@ -74,8 +74,10 @@ void CoProcess::launch(const char **argv, int timeout, int infd, int outfd)
 CoProcess::~CoProcess()
 {
   int status;
-  if(!waitpid(d_pid, &status, WNOHANG)) 
+  if(!waitpid(d_pid, &status, WNOHANG)) {
     kill(d_pid, 9);
+    waitpid(d_pid, &status, 0);
+  }
   
   close(d_fd1[1]);
   fclose(d_fp);