summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d8cd41)
raw | patch | inline | side by side (parent: 1d8cd41)
author | Johannes Sixt <j6t@kdbg.org> | |
Sat, 6 Mar 2010 15:40:39 +0000 (16:40 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 7 Mar 2010 08:37:35 +0000 (00:37 -0800) |
There exist already a number of static functions named 'report', therefore,
the function name was changed.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the function name was changed.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | patch | blob | history | |
git-compat-util.h | patch | blob | history | |
http-backend.c | patch | blob | history | |
usage.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 309f2c58a2ba431a82a56f757482a5093cc8257d..f2ef20cbf03bbf5c34958cbeb876fba3891b1f42 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
static NORETURN void die_nicely(const char *err, va_list params)
{
static int zombie;
- char message[2 * PATH_MAX];
- vsnprintf(message, sizeof(message), err, params);
- fputs("fatal: ", stderr);
- fputs(message, stderr);
- fputc('\n', stderr);
+ vreportf("fatal: ", err, params);
if (!zombie) {
+ char message[2 * PATH_MAX];
+
zombie = 1;
write_crash_report(message);
end_packfile();
diff --git a/git-compat-util.h b/git-compat-util.h
index a3c45373669cd8482c04d5815862ed36a153572d..3cabcdd8c40c34de25a59772fcd72a5c45dc65cc 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#include "compat/bswap.h"
/* General helper functions */
+extern void vreportf(const char *prefix, const char *err, va_list params);
extern NORETURN void usage(const char *err);
extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));
diff --git a/http-backend.c b/http-backend.c
index 345c12b79064f23e0ae0a15781731b9a42272d83..8c7b7d09eaae0d5ac1f3d00f5e3bf9ceb92b54de 100644 (file)
--- a/http-backend.c
+++ b/http-backend.c
static NORETURN void die_webcgi(const char *err, va_list params)
{
- char buffer[1000];
-
http_status(500, "Internal Server Error");
hdr_nocache();
end_headers();
- vsnprintf(buffer, sizeof(buffer), err, params);
- fprintf(stderr, "fatal: %s\n", buffer);
+ vreportf("fatal: ", err, params);
exit(0);
}
index 79856a2b9f5bc4603252cb10b471a0815416a617..ec4cf53b6bf16f7f9b3528a430891d6c68ef64cc 100644 (file)
--- a/usage.c
+++ b/usage.c
*/
#include "git-compat-util.h"
-static void report(const char *prefix, const char *err, va_list params)
+void vreportf(const char *prefix, const char *err, va_list params)
{
char msg[4096];
vsnprintf(msg, sizeof(msg), err, params);
static NORETURN void usage_builtin(const char *err, va_list params)
{
- report("usage: ", err, params);
+ vreportf("usage: ", err, params);
exit(129);
}
static NORETURN void die_builtin(const char *err, va_list params)
{
- report("fatal: ", err, params);
+ vreportf("fatal: ", err, params);
exit(128);
}
static void error_builtin(const char *err, va_list params)
{
- report("error: ", err, params);
+ vreportf("error: ", err, params);
}
static void warn_builtin(const char *warn, va_list params)
{
- report("warning: ", warn, params);
+ vreportf("warning: ", warn, params);
}
/* If we are in a dlopen()ed .so write to a global variable would segfault