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.
This commit is contained in:
Mahmoud Al-Qudsi 2024-01-13 15:41:47 -06:00
parent 6e002b6d80
commit e02c572738

View File

@ -143,7 +143,8 @@ pub struct AutoClosePipes {
pub fn make_autoclose_pipes() -> Option<AutoClosePipes> {
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 {