Skip to content
Snippets Groups Projects
Commit 4f83b70f authored by Alexander Larsson's avatar Alexander Larsson
Browse files

glnx_release_lock_file - Don't close fd -1 (i.e. if we never locked)

This happens a lot if you use autocleanup for lock files, and the
function returns early without the lock being taken.
parent a6d08657
Branches
Tags
No related merge requests found
......@@ -187,7 +187,8 @@ void glnx_release_lock_file(GLnxLockFile *f) {
f->path = NULL;
}
(void) close (f->fd);
if (f->fd != -1)
(void) close (f->fd);
f->fd = -1;
f->operation = 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment