Blob Blame History Raw
From 4d2bb0681fab9ffa019483974a8bca8551ec5d7f Mon Sep 17 00:00:00 2001
From: Fabian Homborg <FHomborg@gmail.com>
Date: Sat, 15 Feb 2020 10:10:59 +0100
Subject: [PATCH 4/4] Fix build on 32-bit systems

This was a weird case of the integer converseys.

Fixes #6609.

(cherry picked from commit 399a71645e76ec103c32dae4caa0778b4bf57eaa)
---
 src/wutil.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/wutil.cpp b/src/wutil.cpp
index ea7bdf694..1d1f0764a 100644
--- a/src/wutil.cpp
+++ b/src/wutil.cpp
@@ -305,10 +305,11 @@ int fd_check_is_remote(int fd) {
     }
     // Linux has constants for these like NFS_SUPER_MAGIC, SMB_SUPER_MAGIC, CIFS_MAGIC_NUMBER but
     // these are in varying headers. Simply hard code them.
-    switch (buf.f_type) {
+    // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER
+    switch ((unsigned int)buf.f_type) {
         case 0x6969:      // NFS_SUPER_MAGIC
         case 0x517B:      // SMB_SUPER_MAGIC
-        case 0xFF534D42:  // CIFS_MAGIC_NUMBER
+        case 0xFF534D42u:  // CIFS_MAGIC_NUMBER
             return 1;
         default:
             // Other FSes are assumed local.
-- 
2.25.0