summaryrefslogtreecommitdiff
path: root/builtin-fetch-pack.c
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2008-08-31 12:09:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-31 23:56:22 (GMT)
commit85e72830697a23dd6b1af8b6bfb3c1a7be60dfae (patch)
tree79d92b09ff24b887bca91fa28f9d573efb2aed69 /builtin-fetch-pack.c
parent7f314565fe20e324e8db1a7c233e43ca4e3683f0 (diff)
downloadgit-85e72830697a23dd6b1af8b6bfb3c1a7be60dfae.zip
git-85e72830697a23dd6b1af8b6bfb3c1a7be60dfae.tar.gz
git-85e72830697a23dd6b1af8b6bfb3c1a7be60dfae.tar.bz2
cast pid_t's to uintmax_t to improve portability
Some systems (like e.g. OpenSolaris) define pid_t as long, therefore all our sprintf that use %i/%d cause a compiler warning beacuse of the implicit long->int cast. To make sure that we fit the limits, we display pids as PRIuMAX and cast them explicitly to uintmax_t. Signed-off-by: David Soria Parra <dsp@php.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch-pack.c')
-rw-r--r--builtin-fetch-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 273239a..17a5a42 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -540,7 +540,7 @@ static int get_pack(int xd[2], char **pack_lockfile)
*av++ = "--fix-thin";
if (args.lock_pack || unpack_limit) {
int s = sprintf(keep_arg,
- "--keep=fetch-pack %d on ", getpid());
+ "--keep=fetch-pack %"PRIuMAX " on ", (uintmax_t) getpid());
if (gethostname(keep_arg + s, sizeof(keep_arg) - s))
strcpy(keep_arg + s, "localhost");
*av++ = keep_arg;