在 2007-06-23六的 16:22 +0200,Denis Vlasenko写道:
> On Friday 22 June 2007 14:15, Bin Chen wrote:
> > > > > On Thu, Jun 21, 2007 at 10:51:21AM +0800, Bin Chen wrote:
> > > > > > I am using busybox-1.1 and I found the ctrl-c can't work
> > > > > > when I
> > > > > > telnet
> > > > > > into the board, but ctrl-z can work.
> > > > >
> > > > > > Any idea?
> > > > >
> > > > > Does it work with current trunk or at least 1.6.0?
> > > > > Did you read the FAQ (there is a ctrl-c entry)?
> > > >
> > > > I have not tried a higher version. I do read the FAQ and I know
> > > > the /dev/console need to modified, but I mean telnet, which is pty not
> > > > serial port.
> > >
> > > There was a bug with misplaced setsid detaching telnetd child process
> > > from ctty.
> > >
> > > Please test newest busybox.
> >
> > Thank you. But I just diff the 1.6 with 1.1, both version's telnetd.c
> > contains a setsid() in child. So I think it is not the reason.
>
> setsid was not removed, it was MOVED UP before xopen here:
>
> /* make new process group */
> setsid();
>
> /* open the child's side of the tty. */
> /* NB: setsid() disconnects from any previous ctty's. Therefore
> * we must open child's side of the tty AFTER setsid! */
> fd = xopen(tty_name, O_RDWR); /* becomes our ctty */
> dup2(fd, 0);
> dup2(fd, 1);
> dup2(fd, 2);
> while (fd > 2) close(fd--);
>
> Please actually try newest busybox. For me it works when I ran it like this:
>
> sleep1000 is
>
> int main() {
> sleep(1000);
> }
>
> I run "telnetd -F -l ./sleep1000". Then I do
>
> # telnet 127.0.0.1
>
> Entering character mode
> Escape character is '^]'.
>
> [I'm pressing Ctrl-C]
> Connection closed by foreign host
But i am curious here why I can fix this by sigaction SIGINT to default
action in ash startup. If the telnetd can't obtain the control, it can
never receive the input SIGINT, right?
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox