]> err.no Git - util-linux/commitdiff
swapon: fix swsuspend detection
authorKarel Zak <kzak@redhat.com>
Tue, 15 Apr 2008 21:18:36 +0000 (23:18 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Apr 2008 21:18:36 +0000 (23:18 +0200)
Welcome to hell where S1SUSPEND/S2SUSPEND is

  "swsuspend" in libblkid

and

  "suspend" in libvolume_id

Signed-off-by: Karel Zak <kzak@redhat.com>
mount/swapon.c

index 33d2b135f6d5081a5f0e7594af90e88666e11932..f0c969b619567be3f405ec4ae79e006776d39675 100644 (file)
@@ -175,7 +175,16 @@ static int
 swap_is_suspend(const char *device) {
        const char *type = fsprobe_get_fstype_by_devname(device);
 
-       return (type && strcmp(type, "suspend") == 0) ? 1 : 0;
+       /* S1SUSPEND/S2SUSPEND =
+        *
+        *   "swsuspend" in libblkid
+        *   "suspend" in libvolume_id
+        */
+       if (type && (strcmp(type, "suspend") == 0 ||
+                       strcmp(type, "swsuspend") == 0))
+               return 1;
+
+       return 0;
 }
 
 /* calls mkswap */