[Pm-utils] [Patch] add userspace suspend signature to pm-reset-swap

Peter Jones pjones at redhat.com
Wed Mar 14 07:53:17 PDT 2007


On Tue, 2007-02-20 at 19:36 +0100, Stefan Seyfried wrote:

> The printf for "no signature found" is not really necessary, but i found
> it useful :-)

Eh, I actually like the "no output if no failure" better... Feel free to
convince me otherwise, though ;)

Until then, applied as:

--- src/pm-reset-swap.c 29 Jan 2007 21:49:45 -0000      1.1
+++ src/pm-reset-swap.c 14 Mar 2007 14:51:22 -0000
@@ -95,7 +95,8 @@ int check_resume_block(FILE *dev, off_t 
     if (fread(buf, sizeof (char), 10, dev) != 10)
         return -1;
 
-    if (!strncmp(buf, "S1SUSPEND", 9))
+    if (!strncmp(buf, "S1SUSPEND", 9) ||
+            !strncmp(buf, "ULSUSPEND", 9))
         return 1;
 
     return 0;
@@ -148,7 +149,7 @@ int main(int argc, char *argv[])
         fclose(dev);
         return 2;
     }
-    rc = 1;
+
     if (rc == 1) {
         if (clear_resume_block(dev, 0)) {
             fprintf(stderr, "Could not clear swap signature on \"%s\": %m\n",

-- 
  Peter



More information about the Pm-utils mailing list