diff options
Diffstat (limited to 'src/fs.zig')
| -rw-r--r-- | src/fs.zig | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -293,7 +293,6 @@ pub fn validMountName(name: []const u8) bool { } test "/os refuses a rename or a mode change as not permitted, in words, and still truncates to zero" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try th.withFile(std.testing.allocator, "x\n"); defer p.deinit(); var tmp = std.testing.tmpDir(.{}); @@ -815,7 +814,6 @@ pub fn dotRelative(word: []const u8) bool { /// Restore, a forwarded `pardes ~/x`. The path itself when there is no /// `~` to expand, or no home for it. pub fn expandHome(path: []const u8, out: *[4096]u8) []const u8 { - if (comptime !pardes.hosted) return path; if (path.len == 0 or path[0] != '~') return path; // Home as the session that recorded found it (src/tape.zig). return pardes.tape.value(.env, expandHomeHost, .{ path, out }); @@ -1096,10 +1094,7 @@ fn findEmbeddedSource(path: []const u8, allow_root_suffix: bool) ?Source { return null; } -pub const platform_has_fs = !pardes.isolated and switch (pardes.platform) { - .tui, .gui, .macos => true, - .web => false, -}; +pub const platform_has_fs = !pardes.isolated; pub const find_skip = [_][]const u8{ ".git", ".jj", "target", "node_modules", @@ -1445,7 +1440,7 @@ pub const Namespace = struct { pub fn mount(st: *Namespace, gpa: std.mem.Allocator, name: []const u8, dial: []const u8) !void { if (!validMountName(name)) return error.BadMountName; - if (comptime pardes.hosted) try ninep_io.Client.validateDial(dial); + try ninep_io.Client.validateDial(dial); if (dial.len == 0 or std.mem.indexOfScalar(u8, dial, 0) != null) return error.BadDial; for (st.mounts.items) |entry| if (std.mem.eql(u8, name, entry.name)) return error.AlreadyMounted; if (st.mounts.items.len == max_mounts) return error.TooManyMounts; @@ -1487,7 +1482,7 @@ pub fn unmount(p: *Pardes, name: []const u8) !void { (path.len == prefix.len or path[prefix.len] == '/')) return error.MountInUse; } const removed = p.fs.mounts.orderedRemove(index); - if (comptime pardes.hosted) ninep_io.Client.forget(removed.dial); + ninep_io.Client.forget(removed.dial); p.gpa.free(removed.name); p.gpa.free(removed.dial); return; @@ -1504,7 +1499,7 @@ test "the tree's README lists src/ only when the build serves it" { } test "a write open(2) refuses says its errno in words" { - if (comptime @import("builtin").os.tag != .linux or !pardes.hosted) return error.SkipZigTest; + if (comptime @import("builtin").os.tag != .linux) return error.SkipZigTest; // /proc takes no new file: ENOENT, which used to read "open failed". try std.testing.expectError(error.NoSuchFileOrDirectory, writeFile("/proc/pardes-no-such-file", "x")); var words: [128]u8 = undefined; |
