diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-08-09 11:06:36 +0100 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-08-09 11:06:36 +0100 |
commit | 0c49a84ffb8d74506a13653183bfa1ef8ffd2554 (patch) | |
tree | ab01825f9790778ef0dd70bc4de87d76c91cd741 /src/core/rawlog.c | |
parent | 5db6caee0d17eb125d8c7f3090c325ffbee35920 (diff) | |
download | irssi-0c49a84ffb8d74506a13653183bfa1ef8ffd2554.zip |
Add back some ifdefs.
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
Diffstat (limited to 'src/core/rawlog.c')
-rw-r--r-- | src/core/rawlog.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/rawlog.c b/src/core/rawlog.c index a95b9a92..fdd51241 100644 --- a/src/core/rawlog.c +++ b/src/core/rawlog.c @@ -27,7 +27,9 @@ #include "misc.h" #include "write-buffer.h" #include "settings.h" +#ifdef HAVE_CAPSICUM #include "capsicum.h" +#endif #include "servers.h" @@ -127,9 +129,15 @@ void rawlog_open(RAWLOG_REC *rawlog, const char *fname) return; path = convert_home(fname); +#ifdef HAVE_CAPSICUM rawlog->handle = capsicum_open_wrapper(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode); +#else + rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT, + log_file_create_mode); +#endif + g_free(path); if (rawlog->handle == -1) { @@ -156,12 +164,20 @@ void rawlog_save(RAWLOG_REC *rawlog, const char *fname) int f; dir = g_path_get_dirname(fname); +#ifdef HAVE_CAPSICUM capsicum_mkdir_with_parents_wrapper(dir, log_dir_create_mode); +#else + g_mkdir_with_parents(dir, log_dir_create_mode); +#endif g_free(dir); path = convert_home(fname); +#ifdef HAVE_CAPSICUM f = capsicum_open_wrapper(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode); +#else + f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode); +#endif g_free(path); if (f < 0) { |