[BusyBox] ctrl-c doesn't work

Wolfgang Denk wd at denx.de
Tue Jul 27 21:03:28 UTC 2004


In message <D73A25AA6E54D511AD74009027B1110F5BB313 at ORION> you wrote:
> I can not seem to get ctrl-c to work when using busybox through a serial
> interface.  It does work if I telnet into the board.  This did work on older
> revisions of busybox but the newer ones I can not get to work.  Does anyone
> have any insight?

Busybox does not assign a controlling tty; this  has  been  discussed
before. depending on your requirements several options exist to solve
this  problem.  We  use  this  patch  (sorry,  this is against an OLD
version of BB):

--- busybox-0.60.5/init.c.orig	Mon Mar 29 15:15:22 2004
+++ busybox-0.60.5/init.c	Mon Mar 29 15:17:00 2004
@@ -477,6 +477,7 @@ static pid_t run(struct init_action *a)
 	if ((pid = fork()) == 0) 
 	{
 		/* Clean up */
+		ioctl(0, TIOCNOTTY, 0);
 		close(0);
 		close(1);
 		close(2);
@@ -513,6 +514,8 @@ static pid_t run(struct init_action *a)
 		 * they point to the supplied terminal */
 		dup(0);
 		dup(0);
+		ioctl(0, TIOCSCTTY, 1);
+		tcsetpgrp(0, getpgrp());
 
 		/* If the init Action requires us to wait, then force the
 		 * supplied terminal to be the controlling tty. */

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Like winter snow on summer lawn, time past is time gone.



More information about the busybox mailing list