diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-25 15:24:08 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-25 15:24:09 +0900 |
commit | abdf7d8e25f16913f1fcabc0a5e9f125126ffe80 (patch) | |
tree | 777d74bd9a849d666de97cd9463898d01c391375 | |
parent | Merge branch 'hv/mv-nested-submodules-test' (diff) | |
parent | gc: call fscanf() with %<len>s, not %<len>c, when reading hostname (diff) | |
download | tgif-abdf7d8e25f16913f1fcabc0a5e9f125126ffe80.tar.xz |
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
-rw-r--r-- | builtin/gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index c22787ac72..3c5eae0edf 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 = |