index-pack: work around thread-unsafe pread()
[gitweb.git] / builtin / gc.c
index cec8ecd75442e1721ab49be8a4d72b43ce244008..c19545d49e217400ee1736183c870557b9c9d54b 100644 (file)
@@ -223,7 +223,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
                        time(NULL) - st.st_mtime <= 12 * 3600 &&
                        fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
                        /* be gentle to concurrent "gc" on remote hosts */
-                       (strcmp(locking_host, my_host) || !kill(pid, 0));
+                       (strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
                if (fp != NULL)
                        fclose(fp);
                if (should_exit) {