Browse Source

Sketched better handling of self-inflicted SIGs

tags/ZeroThreeZero
Thomas Schmitt 13 years ago
parent
commit
d61f1279c1
2 changed files with 32 additions and 2 deletions
  1. +1
    -1
      cdrskin/cdrskin_timestamp.h
  2. +31
    -1
      libburn/init.c

+ 1
- 1
cdrskin/cdrskin_timestamp.h View File

@@ -1 +1 @@
#define Cdrskin_timestamP "2007.01.11.131302"
#define Cdrskin_timestamP "2007.01.11.131615"

+ 31
- 1
libburn/init.c View File

@@ -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);


Loading…
Cancel
Save