mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
When rawlog open fails, there's no point in trying to write. Don't.
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
This commit is contained in:
parent
42b5e89f6e
commit
08dc6734b9
@ -128,13 +128,15 @@ void rawlog_open(RAWLOG_REC *rawlog, const char *fname)
|
|||||||
path = convert_home(fname);
|
path = convert_home(fname);
|
||||||
rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT,
|
rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT,
|
||||||
log_file_create_mode);
|
log_file_create_mode);
|
||||||
if (rawlog->handle == -1) {
|
|
||||||
g_warning("rawlog open() failed: %s", strerror(errno));
|
|
||||||
}
|
|
||||||
g_free(path);
|
g_free(path);
|
||||||
|
|
||||||
|
if (rawlog->handle == -1) {
|
||||||
|
g_warning("rawlog open() failed: %s", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rawlog_dump(rawlog, rawlog->handle);
|
rawlog_dump(rawlog, rawlog->handle);
|
||||||
rawlog->logging = rawlog->handle != -1;
|
rawlog->logging = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rawlog_close(RAWLOG_REC *rawlog)
|
void rawlog_close(RAWLOG_REC *rawlog)
|
||||||
|
Loading…
Reference in New Issue
Block a user