File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
libc/src/sys/statvfs/linux Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,15 @@ LIBC_INLINE struct statvfs statfs_to_statvfs(const LinuxStatFs &in) {
7777 struct statvfs out;
7878 out.f_bsize = in.f_bsize ;
7979 out.f_frsize = in.f_frsize ;
80- out.f_blocks = in.f_blocks ;
81- out.f_bfree = in.f_bfree ;
82- out.f_bavail = in.f_bavail ;
83- out.f_files = in.f_files ;
84- out.f_ffree = in.f_ffree ;
85- out.f_favail = in.f_ffree ;
86- out.f_fsid = in.f_fsid .val [0 ] |
87- static_cast <decltype (out.f_fsid )>(in.f_fsid .val [1 ]) << 32 ;
80+ out.f_blocks = static_cast <decltype (out.f_blocks )>(in.f_blocks );
81+ out.f_bfree = static_cast <decltype (out.f_bfree )>(in.f_bfree );
82+ out.f_bavail = static_cast <decltype (out.f_bavail )>(in.f_bavail );
83+ out.f_files = static_cast <decltype (out.f_files )>(in.f_files );
84+ out.f_ffree = static_cast <decltype (out.f_ffree )>(in.f_ffree );
85+ out.f_favail = static_cast <decltype (out.f_favail )>(in.f_ffree );
86+ out.f_fsid = in.f_fsid .val [0 ];
87+ if constexpr (sizeof (decltype (out.f_fsid )) == sizeof (uint64_t ))
88+ out.f_fsid |= static_cast <decltype (out.f_fsid )>(in.f_fsid .val [1 ]) << 32 ;
8889 out.f_flag = in.f_flags ;
8990 out.f_namemax = in.f_namelen ;
9091 return out;
You can’t perform that action at this time.
0 commit comments