summaryrefslogtreecommitdiff
path: root/src/tty
diff options
context:
space:
mode:
Diffstat (limited to 'src/tty')
-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.