#else
#include <unistd.h>
+#include <errno.h>
static const char *appname;
void vverbose(int level, const char *file, int line, const char *function, 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);
- if (file != NULL && (!tty || verbosity >5))
+ if (file != NULL && (!tty || verbosity > 2))
fprintf(stderr, " [%s:%d,%s]\n", file, line, function);
else
fprintf(stderr, "\n");