Call the cleanup mehtod before doing an exit to prevent stale pid
files.
if (mypath == NULL) {
fprintf(stderr, "ERROR: out of mem\n");
+ cleanup();
exit(1);
}
char ev_path[128];
char buf[256];
int len;
-
FILE* fd;
len = strlen(args.path);
if (len > 128 - 7 /*len of "events" */) {
fprintf(stderr, "pathname to long\n");
+ cleanup();
exit(1);
}
fd = fopen(ev_path, "r");
if (fd == NULL) {
- fprintf(stderr, "ERROR: could not open event file...\n");
+ fprintf(stderr,"devmand error: could not open event "
+ "file %s bailing out\n", ev_path);
+ cleanup();
exit(1);
}