ctrl-c doesn't work but ctrl-z is ok in telnet
Bin Chen
binary.chen at gmail.com
Sat Jun 23 00:20:58 UTC 2007
在 2007-06-22五的 10:37 -0700,David Daney写道:
> Bin Chen wrote:
> > A little update for this problem, I wrote a propram to test the CTRL-C
> > signal, I found if I call:
> >
> > signal(SIGINT, handler);
> >
> > in main(), then the program can get the SIGINT when I press CTRL-C, but
> > if I comment out this line, the SIGINT can't cause the program exit.
> >
> > I think this is caused by the default SIGINT processing logic inherited
> > from the busybox shell, right? In older busybox version we didn't
> > encounter this before, so maybe the reason is the default processing
> > logic for SIGINT in older busybox shell is exit.
> >
> > Will a program started from shell inherit the signal processing
> > properties from the shell?
> >
>
> That explains it. I have a busybox 1.00 system that has been annoying
> me with this behavior.
>
> The setting of SIG_DFL/SIG_IGN and the signal mask are inherited by
> child processes. If telnetd masked SIGINT or set it to SIG_IGN that
> might keep the child processes from receiving the SIGINT.
>
I solved this problem by modify the ash.c to force the SIGINT to set to
SIG_DFL.
More information about the busybox
mailing list