[BusyBox] job control/SIGINT

Andre' Draszik ad at fischlustig.de
Mon Nov 11 18:00:03 UTC 2002


Hi,

i know this has been a topic here quite often, yet it seems i need some 
help.

basically pressing ctrl-c to terminate someting like a 'ping' causes ash 
to quit as well, although ash doesn't complain at all about 
non-accessibilty of tty. and yes, i #defined BB_FEATURE_JOB_CONTROL.

so i just started looking at the source and around line 6591 of busybox' 
0.60.5 ash.c i found

#ifdef BB_FEATURE_ASH_JOB_CONTROL
   if (jp->jobctl) {
     /*
      * This is truly gross.
      * If we're doing job control, then we did a TIOCSPGRP which
      * caused us (the shell) to no longer be in the controlling
      * session -- so we wouldn't have seen any ^C/SIGINT.  So, we
      * intuit from the subprocess exit status whether a SIGINT
      * occured, and if so interrupt ourselves.  Yuck.  - mycroft
      */
     if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
       raise(SIGINT);
   }
   if (jp->state == JOBDONE)
#endif


if i comment out the raise(SIGINT) everything seems to work. but why 
should this be neccessary? i mean, i didn't see a message referring to 
this particular piece of code before, so anybody got an idea why this 
seems to be neccessary on my system, and what implications disabling 
this might have?

André




More information about the busybox mailing list