summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/gc.c2
-rw-r--r--git-compat-util.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 005adbebea..9023aee23c 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -222,7 +222,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
* running.
*/
time(NULL) - st.st_mtime <= 12 * 3600 &&
- fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
+ fscanf(fp, "%"SCNuMAX" %127c", &pid, locking_host) == 2 &&
/* be gentle to concurrent "gc" on remote hosts */
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
if (fp != NULL)
diff --git a/git-compat-util.h b/git-compat-util.h
index 6a16e20966..33bb762296 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -237,6 +237,10 @@ extern char *gitbasename(char *);
#define PRIuMAX "llu"
#endif
+#ifndef SCNuMAX
+#define SCNuMAX PRIuMAX
+#endif
+
#ifndef PRIu32
#define PRIu32 "u"
#endif