mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
termio/exec: use Command.wait rather than posix.waitpid
This commit is contained in:
@ -1297,13 +1297,10 @@ const Subprocess = struct {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// See Command.zig wait for why we specify WNOHANG.
|
const ret = command.wait(false);
|
||||||
// The gist is that it lets us detect when children
|
log.debug("wait result={}", .{ret});
|
||||||
// are still alive without blocking so that we can
|
// 0 means the process is still running
|
||||||
// kill them again.
|
if (ret != 0) break;
|
||||||
const res = posix.waitpid(pid, std.c.W.NOHANG);
|
|
||||||
log.debug("waitpid result={}", .{res.pid});
|
|
||||||
if (res.pid != 0) break;
|
|
||||||
std.time.sleep(10 * std.time.ns_per_ms);
|
std.time.sleep(10 * std.time.ns_per_ms);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user