Randy Dunlap wrote:
> From: Randy Dunlap <randy.dun...@oracle.com>
> 
> When in dump mode, don't check for keyboard input (i.e., don't
> check fd0 in the select() syscall).  Otherwise when 'key' is non-zero,
> ticktime (from -t) is destroyed and the program loop exits
> quickly.  If someone wants to kill powertop when in dump mode,
> just kill it with ^C or "kill".
> 
> Signed-off-by: Randy Dunlap <randy.dun...@oracle.com>
> ---
>  powertop.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> --- powertop-1.11.orig/powertop.c
> +++ powertop-1.11/powertop.c
> @@ -855,7 +855,7 @@ int main(int argc, char **argv)
>               int64_t totalevents;
>               fd_set rfds;
>               struct timeval tv;
> -             int key;
> +             int key = 0;
>  
>               int i = 0;
>               double c0 = 0;
> @@ -863,7 +863,8 @@ int main(int argc, char **argv)
>  
>  
>               FD_ZERO(&rfds);
> -             FD_SET(0, &rfds);
> +             if (!dump)
> +                     FD_SET(0, &rfds);
>               tv.tv_sec = ticktime;
>               tv.tv_usec = (ticktime - tv.tv_sec) * 1000000;;
>               do_proc_irq();
> 
> 
> 

looks good to me! thanks.

Auke
_______________________________________________
Discuss mailing list
Discuss@lesswatts.org
http://lists.lesswatts.org/listinfo/discuss

Reply via email to