From: Wolfgang Denk Date: Sat, 07 Jun 2014 00:10:06 +0200 Subject: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C In-Reply-To: References: <1401992872-31985-1-git-send-email-sjg@chromium.org> <1401992872-31985-3-git-send-email-sjg@chromium.org> <20140605214307.9191B3803E7@gemini.denx.de> Message-ID: <20140606221006.17E233804B4@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Simon, In message 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.