Commit 2c5885e9 authored by Max Kellermann's avatar Max Kellermann

log: don't manipulate the umask

If the user wants the log files with a specific mode, he has to start MPD with the correct umask. Don't hard-code that. This fixes a bug: when log cycling failed, MPD would not restore the old umask.
parent 8e9def1b
...@@ -96,17 +96,9 @@ mpd_log_func(const gchar *log_domain, ...@@ -96,17 +96,9 @@ mpd_log_func(const gchar *log_domain,
static int static int
open_log_file(void) open_log_file(void)
{ {
mode_t prev;
int fd;
assert(out_filename != NULL); assert(out_filename != NULL);
prev = umask(0066); return open(out_filename, O_CREAT | O_WRONLY | O_APPEND, 0666);
fd = open(out_filename, O_CREAT | O_WRONLY | O_APPEND, 0666);
umask(prev);
return fd;
} }
void initLog(bool verbose) void initLog(bool verbose)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment