mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
scan.zig: Add explicit cast for struct statfs.f_type
Hopefully fixes #221.
This commit is contained in:
parent
74be277249
commit
e6cfacfa06
1 changed files with 1 additions and 1 deletions
|
|
@ -60,7 +60,7 @@ fn isKernfs(dir: std.fs.Dir, dev: u64) bool {
|
|||
if (kernfs_cache.get(dev)) |e| return e;
|
||||
var buf: c_statfs.struct_statfs = undefined;
|
||||
if (c_statfs.fstatfs(dir.fd, &buf) != 0) return false; // silently ignoring errors isn't too nice.
|
||||
const iskern = switch (buf.f_type) {
|
||||
const iskern = switch (util.castTruncate(u32, buf.f_type)) {
|
||||
// These numbers are documented in the Linux 'statfs(2)' man page, so I assume they're stable.
|
||||
0x42494e4d, // BINFMTFS_MAGIC
|
||||
0xcafe4a11, // BPF_FS_MAGIC
|
||||
|
|
|
|||
Loading…
Reference in a new issue