lock_file: make function-local locks non-static
[gitweb.git] / builtin / gc.c
index f51e5a6500fc294cb719716671259de42f31bfe7..9b6463d4f3418b9b4e955d6e7847a6ba28584914 100644 (file)
@@ -233,7 +233,7 @@ static int need_to_gc(void)
 /* return NULL on success, else hostname running the gc */
 static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
 {
-       static struct lock_file lock;
+       struct lock_file lock = LOCK_INIT;
        char my_host[HOST_NAME_MAX + 1];
        struct strbuf sb = STRBUF_INIT;
        struct stat st;