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 c2d140b commit 0e0756cCopy full SHA for 0e0756c
library/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