diff options
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 3b8dae1e..96c44d14 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -382,7 +382,7 @@ pub fn statusText(p: *Pardes) []const u8 { var w: std.Io.Writer.Allocating = .init(p.scratch.allocator()); var count: usize = 0; for (p.panes) |slot| count += @intFromBool(slot != null); - const pid: u32 = if (comptime pardes.hosted) @intCast(std.c.getpid()) else 0; + const pid: u32 = @intCast(std.c.getpid()); w.writer.print("pid {d}\nversion {s}\npanes {d}\n", .{ pid, pardes.version, count }) catch {}; // Whether the pointer is over this window: what a grip let go past // another window's edge asks of every window, to find the one it was @@ -665,7 +665,7 @@ pub fn writePager(p: *Pardes, req: Req) Reply { var shown: [256]u8 = undefined; return tree.failText(req.tag, E.INVAL, std.fmt.bufPrint(&p.fs.ename, "pager: invalid directory \"{s}\": must be absolute", .{blanked(dir[0..@min(dir.len, shown.len)], &shown)}) catch "pager: invalid directory: must be absolute"); } - if (comptime pardes.hosted) if (dir.len > 0) if (pardes.filesystem.localPath(dir)) |local| { + if (dir.len > 0) if (pardes.filesystem.localPath(dir)) |local| { // A file there is no directory, ENOTDIR; nothing there, ENOENT. if (exec_line.kindOf(local) != .directory) { if (exec_line.kindOf(local) != null) @@ -1596,7 +1596,6 @@ test "exec Save writes the named file through the host" { } test "a refusal's +Unsaved goes in the session's directory when the active pane's directory is not there" { - if (comptime !pardes.hosted) return; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const serial = serialOf(p); @@ -1697,7 +1696,6 @@ test "DumpConfig's whole report writes back to the root ctl, line by line, with } test "a Restore asks again for the ThemeFile the dump names, as a /ctl write of it does" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1726,7 +1724,6 @@ test "a Restore asks again for the ThemeFile the dump names, as a /ctl write of } test "a ThemeFile that fails to load changes nothing: the root ctl still names the one loaded, or none" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1752,7 +1749,6 @@ test "a ThemeFile that fails to load changes nothing: the root ctl still names t } test "after a ThemeFile the root ctl and DumpConfig say ThemeFile and its path, which writes back" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; const p = try withFile(gpa, "x\n"); defer p.deinit(); @@ -1827,7 +1823,6 @@ test "a look whose pane is refused a place fails with that alone, not a missing } test "a Restore of a file that is no dump fails the write before any warning, and a failed Dump fails its write" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const f = pane_files.fileOf(p.panes[0].?).?; @@ -2286,7 +2281,6 @@ test "with no pane at all, the root look opens its file and the root exec runs i } test "a restored pane whose file is gone from disk comes back dirty, and Del asks first" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "kept text\n"); defer p.deinit(); // On disk when dumped, gone by the Restore. @@ -2336,7 +2330,6 @@ test "a focus moved over 9P tells the programs that asked for focus reports, as } test "a Restore of a name in the DumpDir asks for, and logs, the whole path it reads" { - if (comptime !pardes.hosted) return error.SkipZigTest; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); try pardes.dump.dumpState(p); @@ -2853,7 +2846,6 @@ test "a Rename the server answered for this file alone, with other open files sa } test "Find says what it skipped under its names, and a script's Find that finds nothing is told so" { - if (comptime !pardes.hosted) return; const gpa = testing.allocator; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); @@ -2896,7 +2888,6 @@ test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its + test "DumpDir refuses a relative directory and one that may not be written, up front; a Dump there says permission denied" { - if (comptime !pardes.hosted) return; const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); const root_ctl = @backingInt(tree.TopFile.ctl); |
