]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Improving timing about emlrcvr starting sequence
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 31 Mar 2025 20:25:00 +0000 (16:25 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 31 Mar 2025 20:25:00 +0000 (16:25 -0400)
lib/modrec.c
lib/subrou.c

index c3cf5c2be3b24d7daa455735299332bacdc78976..52cb467d478df3d5d4735cb7cd6f1a4e41e6c527 100644 (file)
@@ -305,12 +305,14 @@ PUBLIC void rec_handlesmtp(int argc,char *argv[])
 
 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;
@@ -325,12 +327,21 @@ while (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
index d7bcb9cab4b820540e5a112267ba58d4b56bd29c..4ee7f088998c2e10f4a5843202c1dda82a8a8dd3 100644 (file)
@@ -21,8 +21,8 @@
 
 //version definition 
 #define VERSION "0.6"
-#define RELEASE "37"
-#define BRANCH "dvl"
+#define RELEASE "38"
+#define BRANCH ""
 
 //Public variables
 PUBLIC  int debug=0;            //debug level