mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user