Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mx_flock: Fix mx_funlock()
  • Loading branch information
mariux committed Nov 6, 2015
1 parent af4053d commit a2a368c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mx_flock.c
Expand Up @@ -133,11 +133,17 @@ int mx_funlock(struct mx_flock *lock)
{
int res;

assert(lock);
if (!lock)
return 0;

if (!lock->locked) {
_flock_free(lock);
return 0;
}

assert(lock->fname);
assert(lock->fd >= 0);
assert(lock->operation >= 0);
assert(lock->locked);

res = unlink(lock->fname);
if (res < 0)
Expand Down

0 comments on commit a2a368c

Please sign in to comment.