mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-08-01 02:06:17 -04:00
cli: drop redundant SIGPIPE ignore in the help pager
std.start.maybeIgnoreSigpipe() already installs a noop SIGPIPE handler at startup (std.options.keep_sigpipe defaults to false), so a write to a dead pager returns error.BrokenPipe — which the existing catch handles — instead of killing the process. The manual SIG_IGN was also the disposition std deliberately avoids, since ignored dispositions survive exec and would leak to child processes.
This commit is contained in:
@@ -784,15 +784,6 @@ fn printPaged(allocator: Allocator, text: []const u8) void {
|
||||
child.stderr_behavior = .Inherit;
|
||||
child.spawn() catch return printPlain(text);
|
||||
|
||||
// The pager can exit before we finish writing (e.g. `q` in less, or
|
||||
// `sh -c` failing to find $PAGER); without this the resulting SIGPIPE
|
||||
// would kill us. The process exits right after, so no need to restore.
|
||||
std.posix.sigaction(std.posix.SIG.PIPE, &.{
|
||||
.handler = .{ .handler = std.posix.SIG.IGN },
|
||||
.mask = std.posix.sigemptyset(),
|
||||
.flags = 0,
|
||||
}, null);
|
||||
|
||||
if (child.stdin) |stdin| {
|
||||
var writer = stdin.writer(&.{});
|
||||
// A write error here is the pager exiting early (user quit, or the
|
||||
|
||||
Reference in New Issue
Block a user