diff options
Diffstat (limited to 'builtin/gc.c')
-rw-r--r-- | builtin/gc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 3c78fcb9b1..c22787ac72 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -47,7 +47,7 @@ static struct argv_array prune = ARGV_ARRAY_INIT; static struct argv_array prune_worktrees = ARGV_ARRAY_INIT; static struct argv_array rerere = ARGV_ARRAY_INIT; -static struct tempfile pidfile; +static struct tempfile *pidfile; static struct lock_file log_lock; static struct string_list pack_garbage = STRING_LIST_INIT_DUP; @@ -78,7 +78,7 @@ static void process_log_file(void) */ int saved_errno = errno; fprintf(stderr, _("Failed to fstat %s: %s"), - get_tempfile_path(&log_lock.tempfile), + get_tempfile_path(log_lock.tempfile), strerror(saved_errno)); fflush(stderr); commit_lock_file(&log_lock); @@ -242,7 +242,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid) int fd; char *pidfile_path; - if (is_tempfile_active(&pidfile)) + if (is_tempfile_active(pidfile)) /* already locked */ return NULL; @@ -293,7 +293,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid) write_in_full(fd, sb.buf, sb.len); strbuf_release(&sb); commit_lock_file(&lock); - register_tempfile(&pidfile, pidfile_path); + pidfile = register_tempfile(pidfile_path); free(pidfile_path); return NULL; } |