Hi,

I thought it was useful to be able to get the exit status from s2ram --test.

grts Tim


Index: s2ram-ppc.c
===================================================================
RCS file: /cvsroot/suspend/suspend/s2ram-ppc.c,v
retrieving revision 1.1
diff -u -r1.1 s2ram-ppc.c
--- s2ram-ppc.c 13 May 2007 20:16:53 -0000      1.1
+++ s2ram-ppc.c 7 Jun 2007 20:49:11 -0000
@@ -39,9 +39,10 @@
        printf("We don't have quirks and hence no whitelist on powerpc\n");
 }
 
-void machine_known(void)
+int machine_known(void)
 {
        printf("We don't have quirks and hence no whitelist on powerpc\n");
+       return 0;
 }
 
 int s2ram_hacks(void)
Index: s2ram-x86.c
===================================================================
RCS file: /cvsroot/suspend/suspend/s2ram-x86.c,v
retrieving revision 1.4
diff -u -r1.4 s2ram-x86.c
--- s2ram-x86.c 1 Jun 2007 10:27:50 -0000       1.4
+++ s2ram-x86.c 7 Jun 2007 20:49:11 -0000
@@ -137,12 +137,13 @@
        return ret;
 }
 
-void machine_known(void)
+int machine_known(void)
 {
        int i = machine_match();
        if (i < 0) {
                printf("Machine unknown\n");
                identify_machine();
+               return 1;
        }
 
        s2ram_check(i);
@@ -168,6 +169,7 @@
         * the one we already have (additional BIOS version e.g)...
         */
        identify_machine();
+       return 0;
 }
 
 int find_vga(void)
Index: s2ram.c
===================================================================
RCS file: /cvsroot/suspend/suspend/s2ram.c,v
retrieving revision 1.57
diff -u -r1.57 s2ram.c
--- s2ram.c     13 May 2007 20:16:53 -0000      1.57
+++ s2ram.c     7 Jun 2007 20:49:11 -0000
@@ -74,8 +74,8 @@
                        identify_machine();
                        exit(0);
                case 'n':
-                       machine_known();
-                       exit(0);
+                       ret = machine_known();
+                       exit(ret);
                case '?':
                        usage("s2ram", options, optstring);
                        exit(1);
Index: s2ram.h
===================================================================
RCS file: /cvsroot/suspend/suspend/s2ram.h,v
retrieving revision 1.9
diff -u -r1.9 s2ram.h
--- s2ram.h     13 May 2007 20:10:16 -0000      1.9
+++ s2ram.h     7 Jun 2007 20:49:11 -0000
@@ -19,7 +19,7 @@
 int s2ram_hacks(void);
 int s2ram_is_supported(void);
 void identify_machine(void);
-void machine_known(void);
+int machine_known(void);
 int s2ram_do(void);
 int s2ram_generic_do(void);
 void s2ram_resume(void);

Attachment: signature.asc
Description: PGP signature

-------------------------------------------------------------------------
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
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to