summaryrefslogtreecommitdiff
path: root/usage.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-13 03:48:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-15 04:00:25 (GMT)
commite3f43ce765c38f4be94239d07c8c3c596780c514 (patch)
treed79aa6f92cfd935667821cbb1ddd15d4208d666c /usage.c
parent940283101ce87250cf31a592730386f5061e1286 (diff)
downloadgit-e3f43ce765c38f4be94239d07c8c3c596780c514.zip
git-e3f43ce765c38f4be94239d07c8c3c596780c514.tar.gz
git-e3f43ce765c38f4be94239d07c8c3c596780c514.tar.bz2
usage.c: drop set_error_handle()
The set_error_handle() function was introduced by 3b331e926 (vreportf: report to arbitrary filehandles, 2015-08-11) so that run-command could send post-fork, pre-exec errors to the parent's original stderr. That use went away in 79319b194 (run-command: eliminate calls to error handling functions in child, 2017-04-19), which pushes all of the error reporting to the parent. This leaves no callers of set_error_handle(). As we're not likely to add any new ones, let's drop it. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Brandon Williams <bmwill@google.com> Reviewed-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/usage.c b/usage.c
index ad6d291..2623c07 100644
--- a/usage.c
+++ b/usage.c
@@ -6,12 +6,9 @@
#include "git-compat-util.h"
#include "cache.h"
-static FILE *error_handle;
-
void vreportf(const char *prefix, const char *err, va_list params)
{
char msg[4096];
- FILE *fh = error_handle ? error_handle : stderr;
char *p;
vsnprintf(msg, sizeof(msg), err, params);
@@ -19,7 +16,7 @@ void vreportf(const char *prefix, const char *err, va_list params)
if (iscntrl(*p) && *p != '\t' && *p != '\n')
*p = '?';
}
- fprintf(fh, "%s%s\n", prefix, msg);
+ fprintf(stderr, "%s%s\n", prefix, msg);
}
static NORETURN void usage_builtin(const char *err, va_list params)
@@ -88,11 +85,6 @@ void set_die_is_recursing_routine(int (*routine)(void))
die_is_recursing = routine;
}
-void set_error_handle(FILE *fh)
-{
- error_handle = fh;
-}
-
void NORETURN usagef(const char *err, ...)
{
va_list params;