Changeset - d0afb12646d7
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-02-20 14:31:23
hanzz.k@gmail.com
Fixed zombie process caused by bad waitpid call
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/networkpluginserver.cpp
Show inline comments
 
@@ -172,13 +172,13 @@ static unsigned long exec_(std::string path, const char *host, const char *port,
 
#ifndef _WIN32
 
static void SigCatcher(int n) {
 
	pid_t result;
 
	int status;
 
	// Read exit code from all children to not have zombies arround
 
	// WARNING: Do not put LOG4CXX_ here, because it can lead to deadlock
 
	while ((result = waitpid(0, &status, WNOHANG)) > 0) {
 
	while ((result = waitpid(-1, &status, WNOHANG)) > 0) {
 
		if (result != 0) {
 
			if (WIFEXITED(status)) {
 
				if (WEXITSTATUS(status) != 0) {
 
// 					LOG4CXX_ERROR(logger, "Backend can not be started, exit_code=" << WEXITSTATUS(status));
 
				}
 
			}
0 comments (0 inline, 0 general)