lockfile: unlock file if lockfile permissions cannot be adjusted
[gitweb.git] / lockfile.c
index 3df1e8306a4471e3c2868f16609bb70a5f106ca1..d74de8d329a4adc3e9c2b158365292c36a37a10d 100644 (file)
@@ -153,6 +153,7 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
                        int save_errno = errno;
                        error("cannot fix permission bits on %s",
                              lk->filename);
+                       rollback_lock_file(lk);
                        errno = save_errno;
                        return -1;
                }