diff options
-rw-r--r-- | src/core/log.c | 4 | ||||
-rw-r--r-- | src/core/rawlog.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/log.c b/src/core/log.c index 863c5f79..ffe1e779 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -28,7 +28,7 @@ #include "lib-config/iconfig.h" #include "settings.h" -#define LOG_FILE_CREATE_MODE 644 +#define DEFAULT_LOG_FILE_CREATE_MODE 644 #ifdef HAVE_FCNTL static struct flock lock; @@ -418,7 +418,7 @@ void log_init(void) rotate_tag = g_timeout_add(60000, (GSourceFunc) sig_rotate_check, NULL); logs = NULL; - settings_add_int("log", "log_create_mode", LOG_FILE_CREATE_MODE); + settings_add_int("log", "log_create_mode", DEFAULT_LOG_FILE_CREATE_MODE); settings_add_str("log", "log_timestamp", "%H:%M "); settings_add_str("log", "log_open_string", "--- Log opened %a %b %d %H:%M:%S %Y"); settings_add_str("log", "log_close_string", "--- Log closed %a %b %d %H:%M:%S %Y"); diff --git a/src/core/rawlog.c b/src/core/rawlog.c index c67cd161..8193f26f 100644 --- a/src/core/rawlog.c +++ b/src/core/rawlog.c @@ -25,10 +25,10 @@ #include "misc.h" #include "settings.h" -#include "common-setup.h" static int rawlog_lines; static int signal_rawlog; +static int log_file_create_mode; RAWLOG_REC *rawlog_create(void) { @@ -113,7 +113,7 @@ void rawlog_open(RAWLOG_REC *rawlog, const char *fname) return; path = convert_home(fname); - rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT, LOG_FILE_CREATE_MODE); + rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode); g_free(path); rawlog_dump(rawlog, rawlog->handle); @@ -134,7 +134,7 @@ void rawlog_save(RAWLOG_REC *rawlog, const char *fname) int f; path = convert_home(fname); - f = open(path, O_WRONLY | O_APPEND | O_CREAT, LOG_FILE_CREATE_MODE); + f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode); g_free(path); rawlog_dump(rawlog, f); @@ -149,6 +149,7 @@ void rawlog_set_size(int lines) static void read_settings(void) { rawlog_set_size(settings_get_int("rawlog_lines")); + log_file_create_mode = octal2dec(settings_get_int("log_create_mode")); } void rawlog_init(void) |