From 1af888d9d5a410d1316e2a1f4488032325d889c2 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 11 Jan 2007 13:34:41 +0000 Subject: [PATCH] Sketched better handling of self-inflicted SIGs --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/init.c | 32 ++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 8416faae..5176ebb0 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.11.131302" +#define Cdrskin_timestamP "2007.01.11.131615" diff --git a/libburn/trunk/libburn/init.c b/libburn/trunk/libburn/init.c index 7e89eec6..e9b33827 100644 --- a/libburn/trunk/libburn/init.c +++ b/libburn/trunk/libburn/init.c @@ -209,8 +209,38 @@ ex: int burn_builtin_abort_handler(void *handle, int signum, int flag) { - if(getpid() != abort_control_pid) + if(getpid() != abort_control_pid) { + +#ifdef Not_yeT + pthread_t thread_id; + + /* >>> need better handling of self-induced SIGs + like SIGSEGV or SIGFPE. + Like bonking the control thread if it did not show up + after a short while. + */ + + /* >>> if this is a non-fatal signal : return -2 */ + + thread_id = pthread_self(); + /* >>> find thread_id in worker list of async.c */ + /* >>> if owning a drive : mark idle and canceled + (can't do anything more) */ + + usleep(1000000); /* calm down */ + + /* forward signal to control thread */ + if (abort_control_pid>1) + kill(abort_control_pid, signum); + + /* >>> ??? end thread */; + +#else + usleep(1000000); /* calm down */ return -2; +#endif /* ! Not_yeT */ + + } Cleanup_set_handlers(NULL, NULL, 2); fprintf(stderr,"%sABORT : Trying to shut down drive and library\n", abort_message_prefix);