diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
commit | 43b355734cf192129f2906789185301a61f4cd8a (patch) | |
tree | 35a3a56a085fc590b1864347d49660d421157305 /src/main.c | |
parent | 43255a7f63af65d88bbead4c0d6429ef2008ada8 (diff) | |
download | mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.gz mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.xz mpd-43b355734cf192129f2906789185301a61f4cd8a.zip |
Add WARNING log method. it's the same as ERROR, except that when mpd starts,
warnings are buffered until the error log is opened, and then flushed to the
error log.
git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 58eb8d98a..c65d00e1c 100644 --- a/src/main.c +++ b/src/main.c @@ -289,7 +289,10 @@ void changeToUser(Options * options) { } void openLogFiles(Options * options, FILE ** out, FILE ** err) { - if(options->stdOutput) return; + if(options->stdOutput) { + flushWarningLog(); + return; + } if(NULL==(*out=fopen(options->logFile,"a"))) { ERROR("problem opening file \"%s\" for writing\n", @@ -316,6 +319,7 @@ void openDB(Options * options, char * argv0) { argv0); exit(EXIT_FAILURE); } + flushWarningLog(); initMp3Directory(); if(writeDirectoryDB()<0) { ERROR("problem opening db for reading or writing\n"); @@ -324,6 +328,7 @@ void openDB(Options * options, char * argv0) { if(options->createDB) exit(EXIT_SUCCESS); } if(options->updateDB) { + flushWarningLog(); updateMp3Directory(); exit(EXIT_SUCCESS); } @@ -379,6 +384,7 @@ void setupLogOutput(Options * options, FILE * out, FILE * err) { myfprintfStdLogMode(out, err, options->logFile, options->errorFile); + flushWarningLog(); } /* lets redirect stdin to dev null as a work around for libao bug */ |