1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02: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.
This commit is contained in:
Jörg Thalheim 2025-03-21 16:23:31 +01:00 committed by John Ericson
parent 041394b741
commit 8e0bc2c3a8

View file

@ -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.