summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2008-08-31 14:09:39 +0200
committerJunio C Hamano <gitster@pobox.com>2008-08-31 16:56:22 -0700
commit85e72830697a23dd6b1af8b6bfb3c1a7be60dfae (patch)
tree79d92b09ff24b887bca91fa28f9d573efb2aed69 /fast-import.c
parent7f314565fe20e324e8db1a7c233e43ca4e3683f0 (diff)
downloadgit-85e72830697a23dd6b1af8b6bfb3c1a7be60dfae.tar.gz
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 'fast-import.c')
-rw-r--r--fast-import.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fast-import.c b/fast-import.c
index 7089e6f9e6..acb8e2e360 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -376,7 +376,7 @@ static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);
static void write_crash_report(const char *err)
{
- char *loc = git_path("fast_import_crash_%d", getpid());
+ char *loc = git_path("fast_import_crash_%"PRIuMAX, (uintmax_t) getpid());
FILE *rpt = fopen(loc, "w");
struct branch *b;
unsigned long lu;
@@ -390,8 +390,8 @@ static void write_crash_report(const char *err)
fprintf(stderr, "fast-import: dumping crash report to %s\n", loc);
fprintf(rpt, "fast-import crash report:\n");
- fprintf(rpt, " fast-import process: %d\n", getpid());
- fprintf(rpt, " parent process : %d\n", getppid());
+ fprintf(rpt, " fast-import process: %"PRIuMAX"\n", (uintmax_t) getpid());
+ fprintf(rpt, " parent process : %"PRIuMAX"\n", (uintmax_t) getppid());
fprintf(rpt, " at %s\n", show_date(time(NULL), 0, DATE_LOCAL));
fputc('\n', rpt);