From 4eb0463971e7a806ac8b7cf4c6cfede2b7f4fff8 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 16 Nov 2007 13:42:51 +0100 Subject: [PATCH] Make report() from usage.c public as vreport(). We will use it for customized error reporting routines. --- git-compat-util.h | 1 + usage.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/git-compat-util.h b/git-compat-util.h index f09f244061..d94c683e0c 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -150,6 +150,7 @@ #endif /* General helper functions */ +extern void vreport(const char *prefix, const char *err, va_list params); extern void usage(const char *err) NORETURN; extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); diff --git a/usage.c b/usage.c index 820d09f92b..349f3fb350 100644 --- a/usage.c +++ b/usage.c @@ -5,7 +5,7 @@ */ #include "git-compat-util.h" -static void report(const char *prefix, const char *err, va_list params) +void vreport(const char *prefix, const char *err, va_list params) { char msg[1024]; vsnprintf(msg, sizeof(msg), err, params); @@ -20,18 +20,18 @@ static NORETURN void usage_builtin(const char *err) static NORETURN void die_builtin(const char *err, va_list params) { - report("fatal: ", err, params); + vreport("fatal: ", err, params); exit(128); } static void error_builtin(const char *err, va_list params) { - report("error: ", err, params); + vreport("error: ", err, params); } static void warn_builtin(const char *warn, va_list params) { - report("warning: ", warn, params); + vreport("warning: ", warn, params); } /* If we are in a dlopen()ed .so write to a global variable would segfault