Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mx_flock: Don't unlock before close
We don't need to call flock(fd, LOCK_UN) for a file we are going to
close anyway, so don't do it.

This might make a difference if the lock fd was dupped into another fd.
  • Loading branch information
donald committed Sep 17, 2021
1 parent 402c046 commit 2601e06
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mx_flock.c
Expand Up @@ -149,10 +149,6 @@ int mx_funlock(struct mx_flock *lock)
if (res < 0)
mx_log_warning("unlink(): %m");

res = flock(lock->fd, LOCK_UN);
if (res < 0)
mx_log_warning("flock(): %m");

_flock_close(lock);
_flock_free(lock);

Expand Down

0 comments on commit 2601e06

Please sign in to comment.