X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fverbose.c;h=2b0090737ea4ac6d6c56f3f6f19f2f37d7ba4940;hb=197626868aaf84e9a68e8e7e5397ef1c6883a0f1;hp=88183c27a3ff9289093fd9779d68d2844f48ea48;hpb=59db7c73c9d98414be9edf7056d7afe025512b3e;p=src%2Fapp-framework-binder.git diff --git a/src/verbose.c b/src/verbose.c index 88183c27..2b009073 100644 --- a/src/verbose.c +++ b/src/verbose.c @@ -77,6 +77,7 @@ void verbose_set_name(const char *name, int authority) #else #include +#include static const char *appname; @@ -95,11 +96,13 @@ static const char *prefixes[] = { 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");