summaryrefslogtreecommitdiff
path: root/src/core/rawlog.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2017-11-26 00:31:01 +0100
committerGitHub <noreply@github.com>2017-11-26 00:31:01 +0100
commit466d074200e4893f57c4c716c746e8549af65339 (patch)
treedce2b3013e63b295c14af90d62f9acbd908c2ac7 /src/core/rawlog.c
parent8dfeca57ede1e726de07522a87203ce13676882d (diff)
parent3792bc9ba95b8b9fd12ad60b86b8bbb06e913dc1 (diff)
downloadirssi-466d074200e4893f57c4c716c746e8549af65339.zip
Merge branch 'master' into hide-lines
Diffstat (limited to 'src/core/rawlog.c')
-rw-r--r--src/core/rawlog.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/rawlog.c b/src/core/rawlog.c
index 2ec155fa..fdd51241 100644
--- a/src/core/rawlog.c
+++ b/src/core/rawlog.c
@@ -27,6 +27,9 @@
#include "misc.h"
#include "write-buffer.h"
#include "settings.h"
+#ifdef HAVE_CAPSICUM
+#include "capsicum.h"
+#endif
#include "servers.h"
@@ -126,8 +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) {
@@ -154,11 +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) {