Skip to content
Snippets Groups Projects
Commit e6cfacfa authored by Yorhel's avatar Yorhel
Browse files

scan.zig: Add explicit cast for struct statfs.f_type

Hopefully fixes #221.
parent 74be2772
No related branches found
Tags v2.1.1
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment