|  | @@ -3322,6 +3322,12 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
 | 
	
		
			
				|  |  |  done:
 | 
	
		
			
				|  |  |    if (pid != (pid_t) -1) {
 | 
	
		
			
				|  |  |      kill(pid, SIGKILL);
 | 
	
		
			
				|  |  | +#if !defined(_WIN32)
 | 
	
		
			
				|  |  | +    {
 | 
	
		
			
				|  |  | +        int st;
 | 
	
		
			
				|  |  | +        while (waitpid(pid, &st, 0) != -1);  // clean zombies
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    if (fdin[0] != -1) {
 | 
	
		
			
				|  |  |      close(fdin[0]);
 | 
	
	
		
			
				|  | @@ -5261,8 +5267,6 @@ struct mg_context *mg_start(const struct mg_callbacks *callbacks,
 | 
	
		
			
				|  |  |    // Ignore SIGPIPE signal, so if browser cancels the request, it
 | 
	
		
			
				|  |  |    // won't kill the whole process.
 | 
	
		
			
				|  |  |    (void) signal(SIGPIPE, SIG_IGN);
 | 
	
		
			
				|  |  | -  // Also ignoring SIGCHLD to let the OS to reap zombies properly.
 | 
	
		
			
				|  |  | -  (void) signal(SIGCHLD, SIG_IGN);
 | 
	
		
			
				|  |  |  #endif // !_WIN32
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    (void) pthread_mutex_init(&ctx->mutex, NULL);
 |