X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fexfat-utils.git;a=blobdiff_plain;f=libexfat%2Flog.c;h=034cc09f4553fbe7bfc46be32b10272e5a2b3328;hp=7a2b35d90005f172605e3286a7dfb3f288cb65d4;hb=ee70a1672ad3490ac6ef94296cd5819c80614fa2;hpb=4cb393cfd9b0ab69392612521ee3dbe481ec492d diff --git a/libexfat/log.c b/libexfat/log.c index 7a2b35d..034cc09 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-2013 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); }