aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-22 02:48:40 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-22 02:48:40 -0700
commit8dc17ab196d30802b9a3c61dfef66c398ca01603 (patch)
tree0cea612e75385e523c0dd0481194009cedf9ec22
parent862c5bd6ddc794e658770cfe5283e2833e70712f (diff)
downloadmpd-8dc17ab196d30802b9a3c61dfef66c398ca01603.tar.gz
mpd-8dc17ab196d30802b9a3c61dfef66c398ca01603.tar.xz
mpd-8dc17ab196d30802b9a3c61dfef66c398ca01603.zip
log: remove umask() calls, just change open(2) args
The umask calls were remants of when we used fopen().
-rw-r--r--src/log.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/log.c b/src/log.c
index 2f4c1af0f..faf2d41fc 100644
--- a/src/log.c
+++ b/src/log.c
@@ -215,8 +215,6 @@ mpd_printf mpd_noreturn void FATAL(const char *fmt, ...)
int cycle_log_files(void)
{
- mode_t prev;
-
if (stdout_mode)
return 0;
assert(out_filename);
@@ -225,22 +223,18 @@ int cycle_log_files(void)
DEBUG("Cycling log files...\n");
close_log_files();
- prev = umask(0066);
-
- out_fd = open(out_filename, O_CREAT | O_WRONLY | O_APPEND, 0666);
+ out_fd = open(out_filename, O_CREAT | O_WRONLY | O_APPEND, 0600);
if (out_fd < 0) {
ERROR("error re-opening log file: %s\n", out_filename);
return -1;
}
- err_fd = open(err_filename, O_CREAT | O_WRONLY | O_APPEND, 0666);
+ err_fd = open(err_filename, O_CREAT | O_WRONLY | O_APPEND, 0600);
if (err_fd < 0) {
ERROR("error re-opening error file: %s\n", err_filename);
return -1;
}
- umask(prev);
-
redirect_logs();
DEBUG("Done cycling log files\n");
return 0;