From: Kees Jongenburger Date: Tue, 3 Jul 2012 14:42:08 +0000 (+0000) Subject: devmand call the cleanup method before doing an exit. X-Git-Tag: v3.2.1~462 X-Git-Url: http://zhaoyanbai.com/repos/doxygen.log?a=commitdiff_plain;h=101b99bc774876d08b2646331ed1235e94e16333;p=minix.git devmand call the cleanup method before doing an exit. Call the cleanup mehtod before doing an exit to prevent stale pid files. --- diff --git a/commands/devmand/main.c b/commands/devmand/main.c index 708142e41..0e831adc2 100644 --- a/commands/devmand/main.c +++ b/commands/devmand/main.c @@ -510,6 +510,7 @@ static enum dev_type determine_type (char *path) if (mypath == NULL) { fprintf(stderr, "ERROR: out of mem\n"); + cleanup(); exit(1); } @@ -862,7 +863,6 @@ static void main_loop() char ev_path[128]; char buf[256]; int len; - FILE* fd; len = strlen(args.path); @@ -872,6 +872,7 @@ static void main_loop() if (len > 128 - 7 /*len of "events" */) { fprintf(stderr, "pathname to long\n"); + cleanup(); exit(1); } @@ -885,7 +886,9 @@ static void main_loop() 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); }