summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/verbose.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/verbose.c b/src/verbose.c
index 6d0db01..3a0559e 100644
--- a/src/verbose.c
+++ b/src/verbose.c
@@ -52,6 +52,7 @@ void verbose_set_name(const char *name, int authority)
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
static char *appname;
@@ -70,7 +71,9 @@ static const char *prefixes[] = {
void vverbose(int level, const char *file, int line, const char *fmt, va_list args)
{
+ int saverr = errno;
int tty = isatty(fileno(stderr));
+ errno = saverr;
fprintf(stderr, "%s: ", prefixes[LEVEL(level)] + (tty ? 4 : 0));
vfprintf(stderr, fmt, args);