summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-25 06:24:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-25 06:24:09 (GMT)
commitabdf7d8e25f16913f1fcabc0a5e9f125126ffe80 (patch)
tree777d74bd9a849d666de97cd9463898d01c391375 /builtin/gc.c
parent450b9086484775c99d512c5a6d68fba232183579 (diff)
parentafe2fab72c3151d02314ab5ef3708cd203c499e5 (diff)
downloadgit-abdf7d8e25f16913f1fcabc0a5e9f125126ffe80.zip
git-abdf7d8e25f16913f1fcabc0a5e9f125126ffe80.tar.gz
git-abdf7d8e25f16913f1fcabc0a5e9f125126ffe80.tar.bz2
Merge branch 'aw/gc-lockfile-fscanf-fix'
"git gc" tries to avoid running two instances at the same time by reading and writing pid/host from and to a lock file; it used to use an incorrect fscanf() format when reading, which has been corrected. * aw/gc-lockfile-fscanf-fix: gc: call fscanf() with %<len>s, not %<len>c, when reading hostname
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index c22787a..3c5eae0 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -258,7 +258,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
int should_exit;
if (!scan_fmt)
- scan_fmt = xstrfmt("%s %%%dc", "%"SCNuMAX, HOST_NAME_MAX);
+ scan_fmt = xstrfmt("%s %%%ds", "%"SCNuMAX, HOST_NAME_MAX);
fp = fopen(pidfile_path, "r");
memset(locking_host, 0, sizeof(locking_host));
should_exit =