summaryrefslogtreecommitdiff
path: root/src/core/rawlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/rawlog.c')
-rw-r--r--src/core/rawlog.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/rawlog.c b/src/core/rawlog.c
index 875c0ef2..5927e730 100644
--- a/src/core/rawlog.c
+++ b/src/core/rawlog.c
@@ -150,13 +150,18 @@ void rawlog_save(RAWLOG_REC *rawlog, const char *fname)
int f;
dir = g_path_get_dirname(fname);
- mkpath(dir, log_dir_create_mode);
+ g_mkdir_with_parents(dir, log_dir_create_mode);
g_free(dir);
path = convert_home(fname);
f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
g_free(path);
+ if (f < 0) {
+ g_warning("rawlog open() failed: %s", strerror(errno));
+ return;
+ }
+
rawlog_dump(rawlog, f);
close(f);
}