From d61f1279c1be3a967edf1666b1c8fa9ada8c63c6 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 --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/init.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 8416faa..5176ebb 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.11.131302" +#define Cdrskin_timestamP "2007.01.11.131615" diff --git a/libburn/init.c b/libburn/init.c index 7e89eec..e9b3382 100644 --- a/libburn/init.c +++ b/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);