From dfb5f064a517cdbde1d658971efb97132a0c3f25 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 17 Feb 2022 13:48:01 +0100 Subject: [PATCH] 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 --- libmount/src/fs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } /** -- 2.47.2