Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NWyd4-0004hW-1G for mharc-grub-devel@gnu.org; Mon, 18 Jan 2010 15:55:18 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWyd2-0004hG-80 for grub-devel@gnu.org; Mon, 18 Jan 2010 15:55:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWycx-0004gj-Ia for grub-devel@gnu.org; Mon, 18 Jan 2010 15:55:15 -0500 Received: from [199.232.76.173] (port=51719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWycx-0004gg-Cc for grub-devel@gnu.org; Mon, 18 Jan 2010 15:55:11 -0500 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:53467) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWycx-00027w-1H for grub-devel@gnu.org; Mon, 18 Jan 2010 15:55:11 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1NWycv-0007l0-TA for grub-devel@gnu.org; Mon, 18 Jan 2010 20:55:10 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1NWycu-0001Js-00; Mon, 18 Jan 2010 20:55:08 +0000 Date: Mon, 18 Jan 2010 20:55:08 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20100118205508.GX5847@riva.ucam.org> References: <201001182117.41329.szymon@janc.net.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001182117.41329.szymon@janc.net.pl> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] make 'sleep --interruptible 0' interruptible X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 20:55:16 -0000 On Mon, Jan 18, 2010 at 09:17:41PM +0100, Szymon Janc wrote: > Attached patch makes sleep -i 0 "interruptible". > It allows to have 0 sleep yet selectable multiboot config > i.e. > > if sleep --interruptible 0 ; then > set timeout=0 > fi > --- grub_orig/grub2-1.98~experimental.20100111.1/commands/sleep.c 2010-01-11 20:01:15.000000000 +0100 > +++ grub/grub2-1.98~experimental.20100111.1/commands/sleep.c 2010-01-18 20:37:56.107189595 +0100 > @@ -44,19 +44,26 @@ > grub_printf ("%d ", n); > } > > +static int > +do_check_key_press (void) > +{ > + return (grub_checkkey () >= 0 > + && GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC); > +} On the PC architecture, you can't check for Escape without having some kind of delay. Only modifier keys can be checked instantaneously. http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/lucid/grub2/lucid/annotate/head%3A/debian/patches/951_sleep_shift.diff has an alternative patch which may be helpful, and links to previous discussions. -- Colin Watson [cjwatson@ubuntu.com]