Fixup history file EINTR loop to actually loop

Fixes d84e68dd4f (Retry history file flock() on EINTR, 2025-05-20).

(cherry picked from commit 3867163193)
This commit is contained in:
Johannes Altmanninger
2025-05-20 17:16:09 +02:00
parent 5ccd155177
commit 33f8415785

View File

@@ -1355,12 +1355,12 @@ unsafe fn maybe_lock_file(file: &mut File, lock_type: libc::c_int) -> bool {
let (ok, start_time) = loop {
let start_time = SystemTime::now();
if unsafe { flock(raw_fd, lock_type) } == -1 {
if errno::errno().0 != EINTR {
break (false, start_time);
}
if unsafe { flock(raw_fd, lock_type) } != -1 {
break (true, start_time);
}
if errno::errno().0 != EINTR {
break (false, start_time);
}
break (true, start_time);
};
if let Ok(duration) = start_time.elapsed() {
if duration > Duration::from_millis(250) {