From: Karel Zak Date: Thu, 17 Feb 2022 12:48:01 +0000 (+0100) Subject: libmount: fix mnt_fs_is_* return codes X-Git-Tag: v2.38-rc2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfb5f064a517cdbde1d658971efb97132a0c3f25;p=thirdparty%2Futil-linux.git libmount: fix mnt_fs_is_* return codes Let's follow the way we already use in context to return 1 or 0 explicitly. Fixes: https://github.com/util-linux/util-linux/issues/1607 Signed-off-by: Karel Zak --- diff --git a/libmount/src/fs.c b/libmount/src/fs.c index b44d310ee2..898ee64fb3 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -600,7 +600,7 @@ int mnt_fs_get_propagation(struct libmnt_fs *fs, unsigned long *flags) */ int mnt_fs_is_kernel(struct libmnt_fs *fs) { - return mnt_fs_get_flags(fs) & MNT_FS_KERNEL; + return mnt_fs_get_flags(fs) & MNT_FS_KERNEL ? 1 : 0; } /** @@ -611,7 +611,7 @@ int mnt_fs_is_kernel(struct libmnt_fs *fs) */ int mnt_fs_is_swaparea(struct libmnt_fs *fs) { - return mnt_fs_get_flags(fs) & MNT_FS_SWAP; + return mnt_fs_get_flags(fs) & MNT_FS_SWAP ? 1 : 0; } /** @@ -622,7 +622,7 @@ int mnt_fs_is_swaparea(struct libmnt_fs *fs) */ int mnt_fs_is_pseudofs(struct libmnt_fs *fs) { - return mnt_fs_get_flags(fs) & MNT_FS_PSEUDO; + return mnt_fs_get_flags(fs) & MNT_FS_PSEUDO ? 1 : 0; } /** @@ -633,7 +633,7 @@ int mnt_fs_is_pseudofs(struct libmnt_fs *fs) */ int mnt_fs_is_netfs(struct libmnt_fs *fs) { - return mnt_fs_get_flags(fs) & MNT_FS_NET; + return mnt_fs_get_flags(fs) & MNT_FS_NET ? 1 : 0; } /**