grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] make 'sleep --interruptible 0' interruptible


From: Colin Watson
Subject: Re: [PATCH] make 'sleep --interruptible 0' interruptible
Date: Mon, 18 Jan 2010 20:55:08 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

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                                       address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]