Skip to content

Commit

Permalink
Fix forgetting to save statx availability on success
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX authored and gitbot committed Feb 20, 2025
1 parent c5f8add commit 07acf02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ cfg_has_statx! {{
) -> c_int
}

if STATX_SAVED_STATE.load(Ordering::Relaxed) == STATX_STATE::Unavailable as u8 {
let statx_availability = STATX_SAVED_STATE.load(Ordering::Relaxed);
if statx_availability == STATX_STATE::Unavailable as u8 {
return None;
}

Expand Down Expand Up @@ -200,6 +201,9 @@ cfg_has_statx! {{
return None;
}
}
if statx_availability == STATX_STATE::Unknown as u8 {
STATX_SAVED_STATE.store(STATX_STATE::Present as u8, Ordering::Relaxed);
}

// We cannot fill `stat64` exhaustively because of private padding fields.
let mut stat: stat64 = mem::zeroed();
Expand Down

0 comments on commit 07acf02

Please sign in to comment.