Skip to content

src: remove overzealous tcsetattr error check #58200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,11 @@ void ResetStdio() {
while (err == -1 && errno == EINTR); // NOLINT
CHECK_EQ(0, pthread_sigmask(SIG_UNBLOCK, &sa, nullptr));

// Normally we expect err == 0. But if macOS App Sandbox is enabled,
// tcsetattr will fail with err == -1 and errno == EPERM.
CHECK_IMPLIES(err != 0, err == -1 && errno == EPERM);
// We don't check the return value of tcsetattr() because it can fail
// for a number of reasons, none that we can do anything about. Examples:
// - if macOS App Sandbox is enabled, tcsetattr fails with EPERM
// - if the process group is orphaned, e.g. because the user logged out,
// tcsetattr fails with EIO
}
}
#endif // __POSIX__
Expand Down
Loading