Fossil SCM
Avoid zombies on client side by waiting for children. This can happen when there are a large number of changes to transmit.
Commit
308f52a63acf8e1eb74887f0b301d638cb608a2d
Parent
ebafd0c335da492…
1 file changed
+2
+2
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -18,10 +18,11 @@ | ||
| 18 | 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "popen.h" |
| 22 | 22 | #include <signal.h> |
| 23 | +#include <sys/wait.h> | |
| 23 | 24 | |
| 24 | 25 | #ifdef _WIN32 |
| 25 | 26 | #include <windows.h> |
| 26 | 27 | #include <fcntl.h> |
| 27 | 28 | /* |
| @@ -213,7 +214,8 @@ | ||
| 213 | 214 | fclose(pOut); |
| 214 | 215 | #else |
| 215 | 216 | close(fdIn); |
| 216 | 217 | fclose(pOut); |
| 217 | 218 | kill(childPid, SIGINT); |
| 219 | + while( waitpid(0, 0, WNOHANG)>0 ) {} | |
| 218 | 220 | #endif |
| 219 | 221 | } |
| 220 | 222 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -18,10 +18,11 @@ | |
| 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "popen.h" |
| 22 | #include <signal.h> |
| 23 | |
| 24 | #ifdef _WIN32 |
| 25 | #include <windows.h> |
| 26 | #include <fcntl.h> |
| 27 | /* |
| @@ -213,7 +214,8 @@ | |
| 213 | fclose(pOut); |
| 214 | #else |
| 215 | close(fdIn); |
| 216 | fclose(pOut); |
| 217 | kill(childPid, SIGINT); |
| 218 | #endif |
| 219 | } |
| 220 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -18,10 +18,11 @@ | |
| 18 | ** This file contains an implementation of a bi-directional popen(). |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "popen.h" |
| 22 | #include <signal.h> |
| 23 | #include <sys/wait.h> |
| 24 | |
| 25 | #ifdef _WIN32 |
| 26 | #include <windows.h> |
| 27 | #include <fcntl.h> |
| 28 | /* |
| @@ -213,7 +214,8 @@ | |
| 214 | fclose(pOut); |
| 215 | #else |
| 216 | close(fdIn); |
| 217 | fclose(pOut); |
| 218 | kill(childPid, SIGINT); |
| 219 | while( waitpid(0, 0, WNOHANG)>0 ) {} |
| 220 | #endif |
| 221 | } |
| 222 |