summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-02-13 13:15:33 +0100
committerLemonBoy <thatlemon@gmail.com>2016-06-05 16:24:55 +0200
commit8289f360757870b56a15576a20e79e1f2ca30fef (patch)
tree9dc5e2ff9ea372270c6845c09c81489384307da5 /src
parentbb190be0bfac956ada4f74a514ff70f28b114efa (diff)
downloadirssi-8289f360757870b56a15576a20e79e1f2ca30fef.zip
Check the return value of open() in rawlog.c
Diffstat (limited to 'src')
-rw-r--r--src/core/rawlog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/rawlog.c b/src/core/rawlog.c
index 2b46c50d..5927e730 100644
--- a/src/core/rawlog.c
+++ b/src/core/rawlog.c
@@ -157,6 +157,11 @@ void rawlog_save(RAWLOG_REC *rawlog, const char *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);
}