Skip to content

Commit

Permalink
tty: assume posix systems support posix.empty_sigset
Browse files Browse the repository at this point in the history
It should be pretty safe to assume that posix.empty_sigset
is supported on most, if not all, posix systems. Individual
OSes that need a different default value may add a case to
the switch like macos.

This should open up support for most other posix systems.

closes #151
  • Loading branch information
neurocyte authored and rockorager committed Jan 14, 2025
1 parent 2237a70 commit bd0438a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/tty.zig
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ pub const PosixTty = struct {
.handler = .{ .handler = PosixTty.handleWinch },
.mask = switch (builtin.os.tag) {
.macos => 0,
.linux => posix.empty_sigset,
.freebsd => posix.empty_sigset,
else => @compileError("os not supported"),
else => posix.empty_sigset,
},
.flags = 0,
};
Expand Down Expand Up @@ -95,9 +93,7 @@ pub const PosixTty = struct {
.handler = .{ .handler = posix.SIG.DFL },
.mask = switch (builtin.os.tag) {
.macos => 0,
.linux => posix.empty_sigset,
.freebsd => posix.empty_sigset,
else => @compileError("os not supported"),
else => posix.empty_sigset,
},
.flags = 0,
};
Expand Down

0 comments on commit bd0438a

Please sign in to comment.