We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d3465a8 commit 2e62fdaCopy full SHA for 2e62fda
library/std/src/sys/unix/mod.rs
@@ -88,14 +88,15 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
88
];
89
90
while libc::poll(pfds.as_mut_ptr(), 3, 0) == -1 {
91
- if errno() == libc::EINTR {
92
- continue;
93
- }
94
- if errno() == libc::EINVAL {
95
- // RLIMIT_NOFILE may be preventing use of poll()
96
- break 'poll;
+ match errno() {
+ libc::EINTR => continue,
+ libc::EINVAL | libc::EAGAIN | libc::ENOMEM => {
+ // RLIMIT_NOFILE or temporary allocation failures
+ // may be preventing use of poll(), fall back to fcntl
+ break 'poll;
97
+ }
98
+ _ => libc::abort(),
99
}
- libc::abort();
100
101
for pfd in pfds {
102
if pfd.revents & libc::POLLNVAL == 0 {
0 commit comments