[U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C

Wolfgang Denk wd at denx.de
Sat Jun 7 00:10:06 CEST 2014


Dear Simon,

In message <CAPnjgZ15jrh=-tEj-0tFjwBSZyq+0BihKJLEjG3d43wQOowMFg at mail.gmail.com> you wrote:
> 
> > If this happens, I consider it a bug that should be fixed, and not
> > papered over.
> 
> If you look at the code for the 'md' command it calls ctrlc() every
> now and then. Each call results in a getc() which reads a character
> from the console. So we lose characters.

Well, as I mentioned: it looks like a bug that needs fixing.

> > I dislike this idea. It looks wrong to me.  Can we not fix the problem
> > at the root cause?
> 
> I certainly thought about this. I even though maybe we might change
> the serial module to scan ahead and buffer characters, in case there
> is a Ctrl-C in the future. But that itself seems like something for
> the future.

well, I see two sides of this:

1) Looking at sandbox only, we should provide an implementation of
   ctrlc() that does not consume characters from stdin - I thinkwe
   should rather be able to react on signals?

2) With a general point of view, consuming characters for no good is
   always wrong and needs to be fixed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Our business is run on trust.  We trust you will pay in advance.


More information about the U-Boot mailing list