mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-28 20:02:36 -04:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user