From: Jean-Marc Pigeon (Delson) Date: Fri, 9 May 2025 14:52:36 +0000 (-0400) Subject: Found SIGCHLD signal explaination (call to system()) X-Git-Tag: tag-0.8~116 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=2cbc5a0c6cec84fb335f303a7c541922fcc0b807;p=jmp%2Fmailleur Found SIGCHLD signal explaination (call to system()) --- diff --git a/lib/subrou.c b/lib/subrou.c index 7319908..0f2257a 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -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); } diff --git a/lib/uniprc.c b/lib/uniprc.c index e8d334c..76ba303 100644 --- a/lib/uniprc.c +++ b/lib/uniprc.c @@ -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