]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: fix the handling of the value returned by fstab_has_fstype()...
authorFranck Bui <fbui@suse.com>
Tue, 4 Jul 2017 15:41:09 +0000 (17:41 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Jul 2017 15:41:09 +0000 (11:41 -0400)
fstab_has_fstype() returns '1' if fstab contains the passed fstype, not '0'.

src/gpt-auto-generator/gpt-auto-generator.c

index a6b09dcbf18099d4ceb21c7ac2e2b8159f53a52e..a072242430a5c9575c1b6dd3dc6b746588edfa30 100644 (file)
@@ -309,7 +309,7 @@ static int add_swap(const char *path) {
         r = fstab_has_fstype("swap");
         if (r < 0)
                 return log_error_errno(r, "Failed to parse fstab: %m");
-        if (r == 0) {
+        if (r > 0) {
                 log_debug("swap specified in fstab, ignoring.");
                 return 0;
         }