mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 05:26:02 +01:00
MonitorFdHup: raise explicit SysError rather unreachable
Syscalls can fail for many reasons and we don't want to loose the errno
and error context.
(cherry picked from commit 8e0bc2c3a8)
This commit is contained in:
parent
01aace706a
commit
787a14b173
1 changed files with 5 additions and 2 deletions
|
|
@ -39,8 +39,11 @@ public:
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
auto count = poll(fds, 1, -1);
|
auto count = poll(fds, 1, -1);
|
||||||
if (count == -1)
|
if (count == -1) {
|
||||||
unreachable();
|
if (errno == EINTR || errno == EAGAIN)
|
||||||
|
continue;
|
||||||
|
throw SysError("failed to poll() in MonitorFdHup");
|
||||||
|
}
|
||||||
|
|
||||||
/* This shouldn't happen, but can on macOS due to a bug.
|
/* This shouldn't happen, but can on macOS due to a bug.
|
||||||
See rdar://37550628.
|
See rdar://37550628.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue