Make report() from usage.c public as vreportf() and use it.
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>
This commit is contained in:

committed by
Junio C Hamano

parent
1d8cd418b4
commit
ebaa79f462
10
usage.c
10
usage.c
@ -5,7 +5,7 @@
|
||||
*/
|
||||
#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);
|
||||
@ -14,24 +14,24 @@ static void report(const char *prefix, const char *err, va_list 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
|
||||
|
Reference in New Issue
Block a user