summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-23 11:00:44 -0300
committerGabriel Schneider <[email protected]>2026-10-23 17:10:58 -0300
commit80314064f6e81c8828340e010202b446f0e1f36d (patch)
treeaa56e86238ac9397055f601db924868bb6511538 /src/look.zig
parenta53a1aafb9804e943bdcd720c2bb688ecb90a888 (diff)
downloadpardes-80314064f6e81c8828340e010202b446f0e1f36d.tar.gz
pardes-80314064f6e81c8828340e010202b446f0e1f36d.zip
Audit (misc): std mkdir -p and JSON escaping, a 9P late failure's errno from ctl.failureErrno, dead switches and dumpHex out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/look.zig b/src/look.zig
index 588574ed..2d97cb9f 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -32,9 +32,7 @@ const Key = pardes.Key;
const Event = pardes.Event;
const Pardes = pardes.Pardes;
-extern "c" fn fork() c_int;
extern "c" fn execv(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int;
-extern "c" fn _exit(status: c_int) noreturn;
const opener_path: ?[*:0]const u8 = switch (builtin.os.tag) {
.linux => "/usr/bin/xdg-open",
@@ -46,15 +44,15 @@ pub fn openLink(url: []const u8) void {
const opener = opener_path orelse return;
var buf: [1024]u8 = undefined;
const url_z = std.fmt.bufPrintSentinel(&buf, "{s}", .{url}, 0) catch return;
- const pid = fork();
+ const pid = libc.fork();
if (pid < 0) return;
if (pid == 0) {
- if (fork() == 0) {
+ if (libc.fork() == 0) {
@import("host_io.zig").resetChildSignals();
const argv: [3:null]?[*:0]const u8 = .{ opener, url_z.ptr, null };
_ = execv(opener, &argv);
}
- _exit(0);
+ libc._exit(0);
}
_ = libc.waitpid(pid, null, 0);
}