From: Franck Bui Date: Tue, 4 Jul 2017 15:41:09 +0000 (+0200) Subject: gpt-auto-generator: fix the handling of the value returned by fstab_has_fstype()... X-Git-Tag: v234~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a680ae36734a121c5d1767d35bda9e6a923db6d;p=thirdparty%2Fsystemd.git gpt-auto-generator: fix the handling of the value returned by fstab_has_fstype() in add_swap() (#6280) fstab_has_fstype() returns '1' if fstab contains the passed fstype, not '0'. --- diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index a6b09dcbf18..a072242430a 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -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; }