Skip to content

Commit

Permalink
More linting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderBlitz committed Nov 23, 2023
1 parent a28425b commit 47e1f5d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,8 @@ pub struct Flock<T: Flockable>(T);
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
impl<T: Flockable> Drop for Flock<T> {
fn drop(&mut self) {
if Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) }).is_err() {
if !std::thread::panicking() {
panic!("Failed to remove flock.");
}
if Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) }).is_err() && !std::thread::panicking() {
panic!("Failed to remove flock.");
}
}
}
Expand Down

0 comments on commit 47e1f5d

Please sign in to comment.