From 2cbc5a0c6cec84fb335f303a7c541922fcc0b807 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Fri, 9 May 2025 10:52:36 -0400 Subject: [PATCH] Found SIGCHLD signal explaination (call to system()) --- lib/subrou.c | 1 + lib/uniprc.c | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) 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 -- 2.47.3