Skip to content

Commit 65c1e17

Browse files
committed
Report out of memory on FDs bigger than N
1 parent ee96ae2 commit 65c1e17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reactor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<const N: usize> Registrations<N> {
106106
Err(ErrorKind::InvalidInput)?;
107107
}
108108

109-
if fd >= sys::FD_SETSIZE as RawFd {
109+
if fd >= sys::FD_SETSIZE as RawFd || fd >= N as RawFd {
110110
Err(ErrorKind::OutOfMemory)?;
111111
}
112112

0 commit comments

Comments
 (0)