From c879910102cc301904e74d08e2d08be9ed4fb125 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Wed, 8 Dec 2021 21:57:57 -0800 Subject: [PATCH] Fix fstatfs call for compilation on 32 bit systems (#9251) Summary: On some 32-bit systems, BTRFS_SUPER_MAGIC is unsigned while __fsword_t is signed. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9251 Reviewed By: ajkr Differential Revision: D32961651 Pulled By: pdillinger fbshipit-source-id: 78e85fc1336f304a21e4d5961e60957c90daed63 --- env/io_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/env/io_posix.cc b/env/io_posix.cc index 8b09cce57..dbc6bec7e 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -1543,7 +1543,8 @@ PosixDirectory::PosixDirectory(int fd) : fd_(fd) { #ifdef OS_LINUX struct statfs buf; int ret = fstatfs(fd, &buf); - is_btrfs_ = (ret == 0 && buf.f_type == BTRFS_SUPER_MAGIC); + is_btrfs_ = (ret == 0 && buf.f_type == static_cast( + BTRFS_SUPER_MAGIC)); #endif }