diff options
Diffstat (limited to 'runtime/daemon.zig')
| -rw-r--r-- | runtime/daemon.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/runtime/daemon.zig b/runtime/daemon.zig index 595d5107..a964eb0b 100644 --- a/runtime/daemon.zig +++ b/runtime/daemon.zig @@ -241,9 +241,8 @@ extern "c" fn close_range(first: c_uint, last: c_uint, flags: c_int) c_int; /// twice), on the listener and the lock as fds 3 and 4. fn spawn(listener: c_int, lock: c_int) bool { var exe_buf: [4096:0]u8 = undefined; - const n = std.process.executablePath(std.Io.Threaded.global_single_threaded.io(), &exe_buf) catch return false; - exe_buf[n] = 0; - const argv = [_:null]?[*:0]const u8{ &exe_buf, "--daemon", null }; + const exe = upgrade.startPath(&exe_buf) orelse return false; + const argv = [_:null]?[*:0]const u8{ exe, "--daemon", null }; const first = libc.fork(); if (first < 0) return false; if (first == 0) { @@ -268,7 +267,7 @@ fn spawn(listener: c_int, lock: c_int) bool { }; if (null_fd > 4) _ = libc.close(null_fd); _ = libc.chdir("/"); - _ = libc.execve(&exe_buf, &argv, @ptrCast(libc.environ)); + _ = libc.execve(exe, &argv, @ptrCast(libc.environ)); libc._exit(127); } var status: c_int = 0; |
