summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
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);
}