From e02c5727387b180747c91656354bb076402cf12d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sat, 13 Jan 2024 15:41:47 -0600 Subject: [PATCH] Fix build error when HAVE_PIPE2 is true NB: I only encountered this when rewriting the cfg detection, which means that the previous detection wasn't correct since I have pipe2 on Linux but didn't run into this build error before. --- src/fds.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fds.rs b/src/fds.rs index c01587c39..b343e76bd 100644 --- a/src/fds.rs +++ b/src/fds.rs @@ -143,7 +143,8 @@ pub struct AutoClosePipes { pub fn make_autoclose_pipes() -> Option { let mut pipes: [c_int; 2] = [-1, -1]; - let already_cloexec = false; + #[allow(unused_mut, unused_assignments)] + let mut already_cloexec = false; #[cfg(HAVE_PIPE2)] { if unsafe { libc::pipe2(&mut pipes[0], O_CLOEXEC) } < 0 {