diff mbox series

[6/6] mountd: Use unsigned for filesystem type magic constants

Message ID 6ca3eb041a455eb0d37ee359e9831fe5a8605a2f.1566976047.git.ps@pks.im (mailing list archive)
State New, archived
Headers show
Series Fixes for various compiler warnings | expand

Commit Message

Patrick Steinhardt Aug. 28, 2019, 7:10 a.m. UTC
The filesystem type magic constants are all unsigned integers, but we
declare them as signed ones. This may cause a compiler warning when
comparing our own signed magic constants with the unsigned ones return
by statfs64(3).

Fix the issue by uniformly usign unsigned types.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 utils/mountd/cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index ecda18c7..6cfa0549 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -302,7 +302,7 @@  static int get_uuid(const char *val, size_t uuidlen, char *u)
  * we generate the identifier from statfs->f_fsid. The rest are network or
  * pseudo filesystems. (See <linux/magic.h> for the basic IDs.)
  */
-static const long int nonblkid_filesystems[] = {
+static const unsigned long nonblkid_filesystems[] = {
     0x2fc12fc1,    /* ZFS_SUPER_MAGIC */
     0x9123683E,    /* BTRFS_SUPER_MAGIC */
     0xFF534D42,    /* CIFS_MAGIC_NUMBER */
@@ -355,7 +355,7 @@  static int uuid_by_path(char *path, int type, size_t uuidlen, char *uuid)
 	rc = statfs64(path, &st);
 
 	if (type == 0 && rc == 0) {
-		const long int *bad;
+		const unsigned long *bad;
 		for (bad = nonblkid_filesystems; *bad; bad++) {
 			if (*bad == st.f_type)
 				break;