[1.16.2] Can't stop "ping" with CTRL+c

Denys Vlasenko vda.linux at googlemail.com
Fri Jul 8 07:33:30 UTC 2011


On Friday 08 July 2011 07:31, Kevin Cernekee wrote:
> On Thu, Jul 7, 2011 at 9:15 PM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> > It may be a good idea to teach ctty hack to look
> > at /sys/class/tty/console/active.
> 
> OK, I can submit a patch for this.  One of the cases I'd like to
> support in my rootfs is console on /dev/ttyAMA0, and the existing
> logic can only handle tty<n> / ttyS<n>.
> 
> Could you please clarify one thing:
> 
> #ifdef TIOCGSERIAL
>                 else if (ioctl(0, TIOCGSERIAL, &u.sr) == 0) {
>                         /* this is a serial console */
>                         sprintf(console + 8, "S%d", u.sr.line);
>                 }
> #endif
> #ifdef __linux__
>                 else if (ioctl(0, VT_GETSTATE, &u.vt) == 0) {
>                         /* this is linux virtual tty */
>                         sprintf(console + 8, "S%d" + 1, u.vt.v_active);
>                 }
> #endif
> 
> What would cause TIOCGSERIAL to be undefined while __linux__ is
> defined, or vice versa?  Is that intended to support really old
> kernels, broken system headers, or something else?

There is probably no deep wisdom behind it. I think second #ifdef
should be changed to #ifdef VT_GETSTATE, it will make more sense that way.

-- 
vda


More information about the busybox mailing list