]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Found SIGCHLD signal explaination (call to system())
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 9 May 2025 14:52:36 +0000 (10:52 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 9 May 2025 14:52:36 +0000 (10:52 -0400)
lib/subrou.c
lib/uniprc.c

index 73199087821d34b29aee83995e9b6add10ac537d..0f2257aec6d2cc199b896c44511ca8aaae122b1c 100644 (file)
@@ -91,6 +91,7 @@ if ((debug>2)&&(current!=onoff)) {
       (void) snprintf(cmd,sizeof(cmd),"sed -i '/%d/d' %s",getpid(),ENABLE);
       break;
     }
+  (void) rou_alert(0,"JMPDBG leak command=<%s>",cmd);
   if ((status=system(cmd))!=0) {
     (void) rou_alert(0,"status '%d' to memleak command <%s> (bug?)",status,cmd);
     }
index e8d334c5019cec099b6fe681d73f8a7997c9f73d..76ba303463b7640d80731d8178eaaebfdd7e64df 100644 (file)
@@ -215,16 +215,22 @@ while (proceed==true) {
         }
       break;
     case 1     :       //creating the lock directory if needed
-      int status;
-      char cmd[100];
+      DIR *dir;
 
       fullname=rou_apppath(DIRLOCK);
-      (void) snprintf(cmd,sizeof(cmd),"mkdir -p %s",fullname);
-      if ((status=system(cmd))!=0) {
-       (void) rou_alert(9,"Unable to create <%s> directory (system?/bug?)",
-                            fullname);
-       phase=999;      //big trouble, No need to go further
+      if ((dir=opendir(fullname))==(DIR *)0) {
+        int status;
+        char cmd[200];
+
+        (void) snprintf(cmd,sizeof(cmd),"mkdir -p %s",fullname);
+        if ((status=system(cmd))!=0) {
+         (void) rou_alert(9,"Unable to create <%s> directory (system?/bug?)",
+                              fullname);
+         phase=999;    //big trouble, No need to go further
+          }
         }
+      else
+      (void) closedir(dir);
       (void) free(fullname);
       break;
     case 2     :       //setting lock filename