From 0e65ba80ca2b4f3a2a24feb6234f26c18feea71f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Jun 2000 01:04:42 +0000 Subject: common-setup.h wasn't removed from here - Made rawlog to use "log_create_mode" setting. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@273 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/log.c | 4 ++-- src/core/rawlog.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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) -- cgit v1.2.3