]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix mnt_fs_is_* return codes
authorKarel Zak <kzak@redhat.com>
Thu, 17 Feb 2022 12:48:01 +0000 (13:48 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Feb 2022 12:48:01 +0000 (13:48 +0100)
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 <kzak@redhat.com>
libmount/src/fs.c

index b44d310ee2b7cfefb170e4810194df92452636d1..898ee64fb3f2588b7e3bd3ae2f52ded5f070011b 100644 (file)
@@ -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;
 }
 
 /**