From 3d5cb04093961c879209e35f7f20c75ba9ffa65c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 25 Nov 2006 17:06:17 +0000 Subject: [PATCH] Trying to keep signal handler from repeating messages --- cdrskin/cdrskin_timestamp.h | 2 +- cdrskin/cleanup.c | 5 ++++- libburn/cleanup.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index e3458a0..f293a02 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2006.11.25.104047" +#define Cdrskin_timestamP "2006.11.25.170456" diff --git a/cdrskin/cleanup.c b/cdrskin/cleanup.c index 6703240..5ed61ab 100644 --- a/cdrskin/cleanup.c +++ b/cdrskin/cleanup.c @@ -75,6 +75,7 @@ static int non_signal_list_count= 4; /* run time dynamic part */ static char cleanup_msg[4096]= {""}; static int cleanup_exiting= 0; +static int cleanup_has_reported= -1234567890; static void *cleanup_app_handle= NULL; static Cleanup_app_handler_T cleanup_app_handler= NULL; @@ -85,8 +86,10 @@ static int Cleanup_handler_exit(int exit_value, int signum, int flag) { int ret; - if(cleanup_msg[0]!=0) + if(cleanup_msg[0]!=0 && cleanup_has_reported!=signum) { fprintf(stderr,"\n%s\n",cleanup_msg); + cleanup_has_reported= signum; + } if(cleanup_perform_app_handler_first) if(cleanup_app_handler!=NULL) { ret= (*cleanup_app_handler)(cleanup_app_handle,signum,0); diff --git a/libburn/cleanup.c b/libburn/cleanup.c index 6703240..5ed61ab 100644 --- a/libburn/cleanup.c +++ b/libburn/cleanup.c @@ -75,6 +75,7 @@ static int non_signal_list_count= 4; /* run time dynamic part */ static char cleanup_msg[4096]= {""}; static int cleanup_exiting= 0; +static int cleanup_has_reported= -1234567890; static void *cleanup_app_handle= NULL; static Cleanup_app_handler_T cleanup_app_handler= NULL; @@ -85,8 +86,10 @@ static int Cleanup_handler_exit(int exit_value, int signum, int flag) { int ret; - if(cleanup_msg[0]!=0) + if(cleanup_msg[0]!=0 && cleanup_has_reported!=signum) { fprintf(stderr,"\n%s\n",cleanup_msg); + cleanup_has_reported= signum; + } if(cleanup_perform_app_handler_first) if(cleanup_app_handler!=NULL) { ret= (*cleanup_app_handler)(cleanup_app_handle,signum,0);