@@ -749,7 +749,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
749749
750750 pidfile_path = repo_git_path (the_repository , "gc.pid" );
751751 fd = hold_lock_file_for_update (& lock , pidfile_path ,
752- LOCK_DIE_ON_ERROR );
752+ LOCK_DIE_ON_ERROR , LOCKFILE_PID_GC );
753753 if (!force ) {
754754 static char locking_host [HOST_NAME_MAX + 1 ];
755755 static char * scan_fmt ;
@@ -1017,7 +1017,7 @@ int cmd_gc(int argc,
10171017 if (daemonized ) {
10181018 char * path = repo_git_path (the_repository , "gc.log" );
10191019 hold_lock_file_for_update (& log_lock , path ,
1020- LOCK_DIE_ON_ERROR );
1020+ LOCK_DIE_ON_ERROR , LOCKFILE_PID_GC );
10211021 dup2 (get_lock_file_fd (& log_lock ), 2 );
10221022 atexit (process_log_file_at_exit );
10231023 free (path );
@@ -1799,7 +1799,8 @@ static int maintenance_run_tasks(struct maintenance_run_opts *opts,
17991799 struct repository * r = the_repository ;
18001800 char * lock_path = xstrfmt ("%s/maintenance" , r -> objects -> sources -> path );
18011801
1802- if (hold_lock_file_for_update (& lk , lock_path , LOCK_NO_DEREF ) < 0 ) {
1802+ if (hold_lock_file_for_update (& lk , lock_path , LOCK_NO_DEREF ,
1803+ LOCKFILE_PID_GC ) < 0 ) {
18031804 /*
18041805 * Another maintenance command is running.
18051806 *
@@ -2563,7 +2564,8 @@ static int launchctl_schedule_plist(const char *exec_path, enum schedule_priorit
25632564 lock_file_timeout_ms = 150 ;
25642565
25652566 fd = hold_lock_file_for_update_timeout (& lk , filename , LOCK_DIE_ON_ERROR ,
2566- lock_file_timeout_ms );
2567+ lock_file_timeout_ms ,
2568+ LOCKFILE_PID_GC );
25672569
25682570 /*
25692571 * Does this file already exist? With the intended contents? Is it
@@ -3374,7 +3376,8 @@ static int update_background_schedule(const struct maintenance_start_opts *opts,
33743376 struct lock_file lk ;
33753377 char * lock_path = xstrfmt ("%s/schedule" , the_repository -> objects -> sources -> path );
33763378
3377- if (hold_lock_file_for_update (& lk , lock_path , LOCK_NO_DEREF ) < 0 ) {
3379+ if (hold_lock_file_for_update (& lk , lock_path , LOCK_NO_DEREF ,
3380+ LOCKFILE_PID_GC ) < 0 ) {
33783381 if (errno == EEXIST )
33793382 error (_ ("unable to create '%s.lock': %s.\n\n"
33803383 "Another scheduled git-maintenance(1) process seems to be running in this\n"
0 commit comments