summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 23d5335)
raw | patch | inline | side by side (parent: 23d5335)
author | Alex Riesen <raa.lkml@gmail.com> | |
Tue, 21 Aug 2007 03:38:14 +0000 (23:38 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 21 Aug 2007 04:57:50 +0000 (21:57 -0700) |
[sp: minor change to use fputs, thus reducing the patch size]
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 2d5224c1867a081c592d21af1573264455a92aff..078079d404d8245d73ea8ef36d764f2bb311d0a9 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
fputc('\n', rpt);
}
-static void write_crash_report(const char *err, va_list params)
+static void write_crash_report(const char *err)
{
char *loc = git_path("fast_import_crash_%d", getpid());
FILE *rpt = fopen(loc, "w");
fputc('\n', rpt);
fputs("fatal: ", rpt);
- vfprintf(rpt, err, params);
+ fputs(err, rpt);
fputc('\n', rpt);
fputc('\n', rpt);
static NORETURN void die_nicely(const char *err, va_list params)
{
static int zombie;
- va_list x_params;
+ char message[2 * PATH_MAX];
- va_copy(x_params, params);
+ vsnprintf(message, sizeof(message), err, params);
fputs("fatal: ", stderr);
- vfprintf(stderr, err, params);
+ fputs(message, stderr);
fputc('\n', stderr);
if (!zombie) {
zombie = 1;
- write_crash_report(err, x_params);
+ write_crash_report(message);
}
- va_end(x_params);
exit(128);
}