1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #121 from dgl/rawlog-fix

Fix rawlog saving after dac67a5 broke it
This commit is contained in:
Alexander Færøy 2014-08-05 21:21:02 +02:00
commit 18a0cfa915

View File

@ -102,14 +102,15 @@ void rawlog_redirect(RAWLOG_REC *rawlog, const char *str)
static void rawlog_dump(RAWLOG_REC *rawlog, int f) static void rawlog_dump(RAWLOG_REC *rawlog, int f)
{ {
GSList *tmp; GSList *tmp;
ssize_t ret = 1; ssize_t ret = 0;
for (tmp = rawlog->lines; ret && tmp != NULL; tmp = tmp->next) { for (tmp = rawlog->lines; ret != -1 && tmp != NULL; tmp = tmp->next) {
ret = write(f, tmp->data, strlen((char *) tmp->data)); ret = write(f, tmp->data, strlen((char *) tmp->data));
ret &= write(f, "\n", 1); if (ret != -1)
ret = write(f, "\n", 1);
} }
if (ret <= 0) { if (ret == -1) {
g_warning("rawlog write() failed: %s", strerror(errno)); g_warning("rawlog write() failed: %s", strerror(errno));
} }
} }