On Thursday, 2 November 2006 11:24, Pavel Machek wrote:
> Hi!
> 
> > The appended patch allows the users of suspend to abort the image saving by
> > pressing Ctrl+c.
> 
> It would be nice to abort with escape or something... ctrl+c is going
> to be "interesting" for users using splashscreen.

OK

> > -   printf("suspend: Saving image data pages (%u pages) ...     ", 
> > nr_pages);
> > +   /* Switch the state of the terminal so that we can read the keyboard
> > +    * without blocking and with no echo.
> > +    *
> > +    * stdin must be attached to the terminal now.
> > +    */
> > +   abort_possible = !tcgetattr(0 , &savedtrm);
> 
> Extra space before , ...

Yes, thanks.

> > @@ -451,20 +476,34 @@ static int save_image(struct swap_map_ha
> >                     error = swap_write_page(handle);
> >                     if (error)
> >                             break;
> > +
> >                     if (!(nr_pages % m)) {
> >                             printf("\b\b\b\b%3d%%", nr_pages / m);
> >                             splash.progress(20 + (nr_pages / m) * 0.75);
> > +                           if (abort_possible) {
> > +                                   ret = read(0, &c, 1);
> > +                                   if (ret > 0 && c == 3) {
> > +                                           printf(" aborted!\n");
> > +                                           return -EINTR;
> > +                                   }
> 
> So you can easily switch to escape here, right?

Sure, no problem.

> Otherwise it looks okay.

Thanks.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
                R. Buckminster Fuller

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to