[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    icecream/daemon
From:       Stephan Kulow <coolo () kde ! org>
Date:       2006-09-03 11:41:37
Message-ID: 1157283697.146899.21724.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 580378 by coolo:

kill the pid whenever we leave


 M  +8 -0      workit.cpp  


--- trunk/icecream/daemon/workit.cpp #580377:580378
@@ -355,6 +355,9 @@
                         error_client( client, "compiler failed." );
                     delete msg;
                     msg = 0;
+                    kill( pid, SIGTERM ); // make sure it's dead
+                    while ( waitpid(pid, 0, 0) < 0 && errno == EINTR)
+                        ;
                     throw myexception (EXIT_COMPILER_CRASHED);
                     break;
                 }
@@ -441,12 +444,17 @@
                     rmsg.err.append( "client cancelled\n" );
                     close( client_fd );
                     kill( pid, SIGTERM );
+                    while ( waitpid(pid, 0, 0) < 0 && errno == EINTR)
+                        ;
                     return EXIT_CLIENT_KILLED;
                 }
                 // fall through
             case -1:
 		if ( ret < 0 && errno != EINTR ) { // this usually means the logic broke
                     error_client( client, string( "select returned " ) + strerror( errno ) );
+                    kill( pid, SIGTERM ); // make sure it's dead
+                    while ( waitpid(pid, 0, 0) < 0 && errno == EINTR)
+                        ;
                     return EXIT_DISTCC_FAILED;
                 }
                 // fall through; should happen if tvp->tv_sec < 0
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic