in src/vtok_common/src/util/flock.rs [43:57]
fn from_file(file: File, flock_op: libc::c_int) -> IoResult<Self> {
loop {
let rc = unsafe { libc::flock(file.as_raw_fd(), flock_op) };
if rc == 0 {
break;
}
let err = IoError::last_os_error();
// If our wait was interrupted, try to acquire the lock again.
if err.kind() != ErrorKind::Interrupted {
return Err(err);
}
}
Ok(Self(file))
}