We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de5c180 commit ff9b68cCopy full SHA for ff9b68c
std/src/os/fd/owned.rs
@@ -104,7 +104,8 @@ impl BorrowedFd<'_> {
104
#[cfg(target_os = "espidf")]
105
let cmd = libc::F_DUPFD;
106
107
- let fd = cvt(unsafe { libc::fcntl(self.as_raw_fd(), cmd, 0) })?;
+ // Avoid using file descriptors below 3 as they are used for stdio
108
+ let fd = cvt(unsafe { libc::fcntl(self.as_raw_fd(), cmd, 3) })?;
109
Ok(unsafe { OwnedFd::from_raw_fd(fd) })
110
}
111
0 commit comments