Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 3b72885

Browse files
committed
Merge branch 'km/gc-eperm' into maint
A "gc" process running as a different user should be able to stop a new "gc" process from starting. * km/gc-eperm: gc: notice gc processes run by other users
2 parents f5678f1 + ed7eda8 commit 3b72885

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
222222
time(NULL) - st.st_mtime <= 12 * 3600 &&
223223
fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
224224
/* be gentle to concurrent "gc" on remote hosts */
225-
(strcmp(locking_host, my_host) || !kill(pid, 0));
225+
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
226226
if (fp != NULL)
227227
fclose(fp);
228228
if (should_exit) {

0 commit comments

Comments
 (0)