pid_t *childs;
int nbrbind;
+_Bool allbusy;
SOCPTR **bindings;
int phase;
_Bool proceed;
childs=(pid_t)0;
nbrbind=0;
+allbusy=false;
bindings=(SOCPTR **)0;
phase=0;
proceed=true;
childs=(pid_t *)calloc(nbrbind,sizeof(pid_t));
break;
case 1 : //Opening ALL channels
+ allbusy=true;
for (int i=0;i<nbrbind;i++) {
(void) prc_nozombie();
- if (childs[i]==(pid_t)0)
+ if (childs[i]==(pid_t)0) {
+ allbusy=false;
continue;
- if (prc_checkprocess(childs[i])==false)
+ }
+ if (prc_checkprocess(childs[i])==false) {
childs[i]=(pid_t)0;
+ allbusy=false;
+ }
+ }
+ if (allbusy==true) { //all serveur up and running?
+ (void) sleep(1); //yes then relax
+ phase=0; //Lets check again
}
break;
case 2 : //starting one process only