fix: workaround broken dir.statFile on WSL1
Zig standard library does not work with WSL1's semi-broken stat syscall support. To avoid flow being completely unusable on WSL1 we just fall back to a zero mtime if stat fails. This destroys MRU ordering in the file finder on WSL1, but at least it works.
This commit is contained in:
parent
2412dd36e6
commit
a76c1f4909
1 changed files with 4 additions and 1 deletions
|
@ -63,7 +63,10 @@ pub fn start(a_: std.mem.Allocator, root_path_: []const u8) (SpawnError || std.f
|
|||
|
||||
fn next(self: *tree_walker) !void {
|
||||
if (try self.walker.next()) |path| {
|
||||
const stat = self.dir.statFile(path) catch return tp.self_pid().send(.{"next"});
|
||||
const stat = self.dir.statFile(path) catch {
|
||||
try self.parent.send(.{ "walk_tree_entry", self.root_path, path, 0, 0 });
|
||||
return tp.self_pid().send(.{"next"});
|
||||
};
|
||||
const mtime = stat.mtime;
|
||||
const high: i64 = @intCast(mtime >> 64);
|
||||
const low: i64 = @truncate(mtime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue