aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/log.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d68d51ca5..40e37822c 100644
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,7 @@ ver 0.16 (20??/??/??)
* removed options --create-db and --no-create-db
* state_file: save only if something has changed
* database: eliminated maximum line length
+* log: redirect stdout/stderr to /dev/null if syslog is used
* obey $(sysconfdir) for default mpd.conf location
* build with large file support by default
* require GLib 2.16
diff --git a/src/log.c b/src/log.c
index 94691ab64..3a9795d7d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -271,7 +271,10 @@ void setup_log_output(bool use_stdout)
{
fflush(NULL);
if (!use_stdout) {
- if (out_filename != NULL) {
+ if (out_filename == NULL)
+ out_fd = open("/dev/null", O_WRONLY);
+
+ if (out_fd >= 0) {
redirect_logs(out_fd);
close(out_fd);
}