summaryrefslogtreecommitdiff
path: root/src/tty/tty.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-09 06:54:27 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit599dd82f96b9d091aae78300aa6c3fbc81f9eb69 (patch)
tree532d29eb0d79896cd730fb324df4866056306506 /src/tty/tty.zig
parent628aa40f13e9bbd313b51ab625f193110aad8dd0 (diff)
downloadpardes-599dd82f96b9d091aae78300aa6c3fbc81f9eb69.tar.gz
pardes-599dd82f96b9d091aae78300aa6c3fbc81f9eb69.zip
review pass: fix the eaten Tab, drop the duplicated code, cover the gaps
Diffstat (limited to 'src/tty/tty.zig')
-rw-r--r--src/tty/tty.zig11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 91213d9f..ad6f04b0 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -457,15 +457,8 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void {
// --nested opted out of the whole mechanism, including being an outer
// instance; so does any failure to bind, and then children simply open
// their own session.
- var sock_buf: [108]u8 = undefined;
- const sock_path: ?[:0]const u8 = if (opts.nested) null else nested.socketPath(&sock_buf, libc.getpid());
- const sock_fd: c_int = if (sock_path) |sp| nested.listenAt(sp) else -1;
- // only on the fd, so a bind that FAILED cannot unlink a path this process
- // never created
- defer if (sock_fd >= 0) {
- _ = libc.close(sock_fd);
- _ = libc.unlink(sock_path.?);
- };
+ const sock_fd: c_int = if (opts.nested) -1 else nested.listen();
+ defer nested.unlisten(sock_fd);
// Perform the initial spawns BEFORE any worker thread exists: forkpty from
// a multithreaded process can wedge the child before exec.