We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bc0a9e commit bd1ae01Copy full SHA for bd1ae01
1 file changed
src/inherited.rs
@@ -157,6 +157,8 @@ mod test {
157
}
158
159
fn is_fd_opened(raw_fd: RawFd) -> bool {
160
+ // SAFETY: F_GETFD doesn't take any other parameters, and is safe even on an invalid file
161
+ // descriptor.
162
unsafe { libc::fcntl(raw_fd, libc::F_GETFD) != -1 }
163
164
@@ -270,6 +272,7 @@ mod test {
270
272
let fixture = Fixture::setup(2).unwrap();
271
273
let f = fixture.fds[0];
274
275
+ // SAFETY: 0 is a valid parameter for F_SETFD.
276
let res = unsafe { libc::fcntl(f.as_raw_fd(), libc::F_SETFD, 0) };
277
assert_ne!(res, -1);
278
0 commit comments