Browse code

added exit(0) to signal handler for profiling

Jiri Kuthan authored on 07/12/2001 13:15:07
Showing 1 changed files
... ...
@@ -314,6 +314,7 @@ int main_loop()
314 314
 
315 315
 static void sig_usr(int signo)
316 316
 {
317
+	DPrint("INT received, program terminates\n");
317 318
 	if (signo==SIGINT) {	/* exit gracefuly */
318 319
 #ifdef STATS
319 320
 		/* print statistics on exit only for the first process */
... ...
@@ -324,8 +325,6 @@ static void sig_usr(int signo)
324 325
 			else
325 326
 				printf("statistics dump to %s failed\n", stat_file );
326 327
 #endif
327
-		DPrint("INT received, program terminates\n");
328
-		DPrint("Thank you for flying ser\n");
329 328
 		/* WARNING: very dangerous, might be unsafe*/
330 329
 		if (is_main)
331 330
 			destroy_modules();
... ...
@@ -343,7 +342,7 @@ static void sig_usr(int signo)
343 342
 		if (is_main)
344 343
 			shm_mem_destroy();
345 344
 #endif
346
-		exit(0);
345
+		goto bye;
347 346
 	} else if (signo==SIGUSR1) { /* statistic */
348 347
 #ifdef STATS
349 348
 		dump_all_statistic();
... ...
@@ -357,6 +356,9 @@ static void sig_usr(int signo)
357 356
 		shm_status();
358 357
 #endif
359 358
 	}
359
+bye:
360
+	DPrint("Thank you for flying ser\n");
361
+	exit(0);
360 362
 }
361 363
 
362 364