Hi,
One small remark below.
Apart from this looks OK.
On Thursday, 10 May 2007 22:05, Tim Dijkstra wrote:
> Hi,
>
> libsplashy changed the ABI a bit, needed to change something. It also
> would want to know if we're suspend of resuming, it can then show a
> penguin going to bed or waking up.
>
> Index: resume.c
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/resume.c,v
> retrieving revision 1.43
> diff -u -r1.43 resume.c
> --- resume.c 2 May 2007 20:55:43 -0000 1.43
> +++ resume.c 10 May 2007 20:01:14 -0000
> @@ -806,6 +806,8 @@
>
> if (splash_param != 'y' && splash_param != 'Y')
> splash_param = 0;
> + else
> + splash_param = SPL_RESUME;
>
> page_size = getpagesize();
> buffer_size = BUFFER_PAGES * page_size;
> Index: splash.c
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/splash.c,v
> retrieving revision 1.6
> diff -u -r1.6 splash.c
> --- splash.c 18 Jan 2007 23:23:22 -0000 1.6
> +++ splash.c 10 May 2007 20:01:14 -0000
> @@ -11,13 +11,13 @@
>
> #include <stdio.h>
> #include <stdlib.h>
> +#include <unistd.h>
> +#include <termios.h>
>
> #include "splash.h"
> #include "bootsplash.h"
> #include "splashy_funcs.h"
> #include "encrypt.h"
> -#include <unistd.h>
> -#include <termios.h>
>
> /**
> * dummy functions in case if no splash system was found or
> @@ -66,7 +66,7 @@
> }
>
> /* Tries to find a splash system and initializes interface functions */
> -void splash_prepare(struct splash *splash, int enabled)
> +void splash_prepare(struct splash *splash, int mode)
> {
> int error = 0;
>
> @@ -82,7 +82,7 @@
> splash->prepare_abort = prepare_abort;
> splash->restore_abort = restore_abort;
> splash->key_pressed = key_pressed;
> - if (!enabled)
> + if (!mode)
> return;
>
> printf("Looking for splash system... ");
> @@ -94,11 +94,14 @@
> splash->dialog = bootsplash_dialog;
> splash->read_password = bootsplash_read_password;
> #ifdef CONFIG_SPLASHY
> - } else if (!splashy_open()) {
> + } else if (!(error = splashy_open(mode))) {
I'd prefer
error = error = splashy_open(mode);
if (error) {
and analogously below.
> splash->finish = splashy_finish;
> splash->progress = splashy_progress;
> splash->dialog = splashy_dialog;
> splash->read_password = splashy_read_password;
> + splash->prepare_abort = splashy_prepare_abort;
> + splash->restore_abort = splashy_restore_abort;
> + splash->key_pressed = splashy_key_pressed;
> #endif
> } else if (0) {
> /* add another splash system here */
> Index: splash.h
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/splash.h,v
> retrieving revision 1.4
> diff -u -r1.4 splash.h
> --- splash.h 10 Jan 2007 14:16:45 -0000 1.4
> +++ splash.h 10 May 2007 20:01:14 -0000
> @@ -12,6 +12,9 @@
> #ifndef SPLASH_H
> #define SPLASH_H
>
> +#define SPL_SUSPEND 1
> +#define SPL_RESUME 2
> +
> #include <termios.h>
>
> /* generic interface functions for an arbitary splash method */
> @@ -26,6 +29,6 @@
> void (*restore_abort) (struct termios *);
> };
>
> -void splash_prepare(struct splash *splash, int enabled);
> +void splash_prepare(struct splash *splash, int mode);
>
> #endif /* SPLASH_H */
> Index: splashy_funcs.c
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/splashy_funcs.c,v
> retrieving revision 1.3
> diff -u -r1.3 splashy_funcs.c
> --- splashy_funcs.c 20 Sep 2006 14:15:50 -0000 1.3
> +++ splashy_funcs.c 10 May 2007 20:01:14 -0000
> @@ -13,20 +13,27 @@
> #include <string.h>
>
> #include <splashy.h>
> +#include "splash.h"
>
> #include "encrypt.h"
> #include "splashy_funcs.h"
>
> -int splashy_open() //char *mode)
> +int splashy_open(int mode)
> {
> + int ret;
> char * mode="suspend";
> /* Do some detecting logic here ... */
> - if (!splashy_init (NULL,mode))
> + if ((ret = splashy_init (NULL,(mode==SPL_RESUME?"resume":"suspend"))) <
> 0)
> + {
> + fprintf(stderr,"splashy_init: error %d",ret);
> return -1;
> -
> - if (splashy_start_splash () < 0)
> - return -1;
> -
> + }
> +
> + if ((ret = splashy_start_splash ()) < 0) {
> + fprintf(stderr,"splashy_start_splash: error %d",ret);
> + return -2;
> + }
> +
> return 0;
> }
>
> Index: suspend.c
> ===================================================================
> RCS file: /cvsroot/suspend/suspend/suspend.c,v
> retrieving revision 1.77
> diff -u -r1.77 suspend.c
> --- suspend.c 2 May 2007 20:55:43 -0000 1.77
> +++ suspend.c 10 May 2007 20:01:14 -0000
> @@ -1303,6 +1303,8 @@
> #endif
> if (splash_param != 'y' && splash_param != 'Y')
> splash_param = 0;
> + else
> + splash_param = SPL_SUSPEND;
>
> if (early_writeout != 'n' && early_writeout != 'N')
> early_writeout = 1;
>
--
If you don't have the time to read,
you don't have the time or the tools to write.
- Stephen King
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel