summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index 18c51ece..446c24de 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -1015,7 +1015,7 @@ pub fn sweepDeadSockets(io: std.Io, dir: [:0]const u8) void {
i += 1 + name.len;
const pid = deadSocketPid(name).?;
if (pid == libc.getpid()) continue;
- if (std.posix.errno(std.c.kill(pid, @enumFromInt(0))) != .SRCH) continue;
+ if (std.posix.errno(std.c.kill(pid, @fromBackingInt(@intCast(0)))) != .SRCH) continue;
var path_buf: [sun_path_len:0]u8 = undefined;
const path = std.fmt.bufPrintSentinel(&path_buf, "{s}/{s}", .{ dir, name }, 0) catch continue;
const facts = statNoFollow(path) orelse continue;
@@ -1553,7 +1553,7 @@ test "a socket path too long for sun_path is no listener, and leaves the editor'
} else {
_ = unsetenv("XDG_RUNTIME_DIR");
};
- const long = "n" ** 120;
+ const long = &@as([120]u8, @splat('n'));
try testing.expect(listen(testing.io, testing.allocator, p, long, "", null, null) == null);
try testing.expect(pardes.turn.answer_held == null);
try testing.expect(pardes.turn.wake_parked == null);
@@ -1567,7 +1567,7 @@ test "a listening editor posts itself into the 9P registry and unposts on stop"
_ = try std.fmt.bufPrintSentinel(&directory, "/tmp/pardes-post-XXXXXX", .{}, 0);
if (mkdtemp(&directory) == null) return error.TempDirectoryFailed;
const dir = std.mem.span(@as([*:0]const u8, &directory));
- const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null;
+ const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeSentinel(u8, std.mem.span(v), 0) else null;
defer {
if (old_runtime) |v| {
_ = setenv("XDG_RUNTIME_DIR", v, 1);
@@ -1628,7 +1628,7 @@ test "Unix TCP and QUIC share one listener through reads writes reconnects and r
if (mkdtemp(&directory) == null) return error.TempDirectoryFailed;
// What the listener posted and left inside goes with it.
defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)});
- const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null;
+ const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeSentinel(u8, std.mem.span(v), 0) else null;
defer {
if (old_runtime) |v| {
_ = setenv("XDG_RUNTIME_DIR", v, 1);
@@ -1749,7 +1749,7 @@ test "a change waits while the editor is out mid-step, a read does not, and the
if (mkdtemp(&directory) == null) return error.TempDirectoryFailed;
// What the listener posted and left inside goes with it.
defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)});
- const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null;
+ const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeSentinel(u8, std.mem.span(v), 0) else null;
defer {
if (old_runtime) |v| {
_ = setenv("XDG_RUNTIME_DIR", v, 1);
@@ -1824,7 +1824,7 @@ test "a held read is answered when the log has news, and a flushed one spends no
if (mkdtemp(&directory) == null) return error.TempDirectoryFailed;
// What the listener posted and left inside goes with it.
defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)});
- const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null;
+ const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeSentinel(u8, std.mem.span(v), 0) else null;
defer {
if (old_runtime) |v| {
_ = setenv("XDG_RUNTIME_DIR", v, 1);
@@ -2051,7 +2051,7 @@ test "a pane's PARDES_MOUNT is the session's directory under 9ns --mntgen, and u
const names = [_][*:0]const u8{ "NINE_MNTGEN", "NINE_MOUNT", "PARDES_MOUNT" };
var saved: [names.len]?[:0]u8 = @splat(null);
for (names, &saved) |name, *value| {
- if (libc.getenv(name)) |old| value.* = try testing.allocator.dupeZ(u8, std.mem.span(old));
+ if (libc.getenv(name)) |old| value.* = try testing.allocator.dupeSentinel(u8, std.mem.span(old), 0);
}
defer for (names, saved) |name, value| {
if (value) |old| {
@@ -2073,7 +2073,7 @@ test "9P shell environment states being inside pardes apart from how to reach it
const names = [_][*:0]const u8{ "XDG_RUNTIME_DIR", "HOME", "PARDES_PID", "PARDES_9P", "PARDES_PANE" };
var saved: [names.len]?[:0]u8 = @splat(null);
for (names, &saved) |name, *value| {
- if (libc.getenv(name)) |old| value.* = try testing.allocator.dupeZ(u8, std.mem.span(old));
+ if (libc.getenv(name)) |old| value.* = try testing.allocator.dupeSentinel(u8, std.mem.span(old), 0);
}
defer for (names, saved) |name, value| {
if (value) |old| {