GeezerVison is showing github.com — src: remove overzealous tcsetattr error check · nodejs/node@bb28e2b
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node.cc +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -712,9 +712,11 @@ void ResetStdio() { |
712 | 712 | while (err == -1 && errno == EINTR); // NOLINT |
713 | 713 | CHECK_EQ(0, pthread_sigmask(SIG_UNBLOCK, &sa, nullptr)); |
714 | 714 |
|
715 | | - // Normally we expect err == 0. But if macOS App Sandbox is enabled, |
716 | | - // tcsetattr will fail with err == -1 and errno == EPERM. |
717 | | - CHECK_IMPLIES(err != 0, err == -1 && errno == EPERM); |
| 715 | + // We don't check the return value of tcsetattr() because it can fail |
| 716 | + // for a number of reasons, none that we can do anything about. Examples: |
| 717 | + // - if macOS App Sandbox is enabled, tcsetattr fails with EPERM |
| 718 | + // - if the process group is orphaned, e.g. because the user logged out, |
| 719 | + // tcsetattr fails with EIO |
718 | 720 | } |
719 | 721 | } |
720 | 722 | #endif // __POSIX__ |
|