1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Check the return value of open() in rawlog.c

This commit is contained in:
LemonBoy 2016-02-13 13:15:33 +01:00
parent bb190be0bf
commit 8289f36075

View File

@ -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); f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
g_free(path); g_free(path);
if (f < 0) {
g_warning("rawlog open() failed: %s", strerror(errno));
return;
}
rawlog_dump(rawlog, f); rawlog_dump(rawlog, f);
close(f); close(f);
} }