(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);
}
}
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