X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfat-utils.git;a=blobdiff_plain;f=libexfat%2Flog.c;h=8b589b406d238ee6388b631455eda37a72cbafe5;hp=7a2b35d90005f172605e3286a7dfb3f288cb65d4;hb=70a4b10edcf53a90140e6dd80ccaa045f3647ad7;hpb=9799d681703e3a63dbbf876c16c9bb51b20c8fab diff --git a/libexfat/log.c b/libexfat/log.c index 7a2b35d..8b589b4 100644 --- a/libexfat/log.c +++ b/libexfat/log.c @@ -2,7 +2,7 @@ log.c (02.09.09) exFAT file system implementation library. - Copyright (C) 2009, 2010 Andrew Nayenko + Copyright (C) 2010-2012 Andrew Nayenko This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include "exfat.h" #include #include +#include int exfat_errors; @@ -40,7 +41,8 @@ void exfat_bug(const char* format, ...) va_end(ap); fputs(".\n", stderr); - vsyslog(LOG_CRIT, format, aq); + if (!isatty(STDERR_FILENO)) + vsyslog(LOG_CRIT, format, aq); va_end(aq); abort(); @@ -63,7 +65,8 @@ void exfat_error(const char* format, ...) va_end(ap); fputs(".\n", stderr); - vsyslog(LOG_ERR, format, aq); + if (!isatty(STDERR_FILENO)) + vsyslog(LOG_ERR, format, aq); va_end(aq); } @@ -84,7 +87,8 @@ void exfat_warn(const char* format, ...) va_end(ap); fputs(".\n", stderr); - vsyslog(LOG_WARNING, format, aq); + if (!isatty(STDERR_FILENO)) + vsyslog(LOG_WARNING, format, aq); va_end(aq); }