Browse code

- hopefully fixed the RH9.0 bug: starting too many Jabber workers (reported by Daminen Vicq <vicq@research.bell-labs.com>) -- possibly result of the SIGCHLD handling -- man waitpid, section about ECHILD

Daniel-Constantin Mierla authored on 19/06/2003 16:17:06
Showing 1 changed files
... ...
@@ -37,6 +37,7 @@
37 37
  * 2003-03-11 New module interface (janakj)
38 38
  * 2003-03-16 flags export parameter added (janakj)
39 39
  * 2003-04-06 rank 0 changed to 1 in child_init (janakj)
40
+ * 2003-06-19 fixed too many Jabber workers bug (mostly on RH9.0) (dcm)
40 41
  */
41 42
 
42 43
 
... ...
@@ -789,7 +790,7 @@ void xjab_check_workers(int mpid)
789 790
 		{
790 791
 			stat = 0;
791 792
 			n = waitpid(jwl->workers[i].pid, &stat, WNOHANG);
792
-			if(n == 0)
793
+			if(n == 0 || n!=jwl->workers[i].pid)
793 794
 				continue;
794 795
 		
795 796
 			LOG(L_ERR,"XJAB:xjab_check_workers: worker[%d][pid=%d] has exited"