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
This commit is contained in:
Adam Retter 2021-12-08 21:57:57 -08:00 committed by Peter Dillinger
parent 5ac7843a03
commit 8e588307fc

3
env/io_posix.cc vendored
View File

@ -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<decltype(buf.f_type)>(
BTRFS_SUPER_MAGIC));
#endif
}