1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-21 03:14:16 -04:00

Flush the dirty buffer to disk

Given a big enough write_buffer_size and a long enough
write_buffer_timeout it might be possible to show the user an incomplete
or empty awaylog.

Patch by: Petteri Aimonen
This commit is contained in:
LemonBoy 2015-10-02 17:13:49 +02:00
parent acbe2ecac2
commit db5ae4adce

View File

@ -62,6 +62,9 @@ static void awaylog_open(void)
return;
}
/* Flush the dirty buffers to disk before acquiring the file position */
write_buffer_flush();
awaylog = log;
away_filepos = lseek(log->handle, 0, SEEK_CUR);
away_msgs = 0;
@ -83,6 +86,9 @@ static void awaylog_close(void)
if (awaylog == log) awaylog = NULL;
/* Flush the dirty buffers to disk before showing the away log */
write_buffer_flush();
signal_emit("awaylog show", 3, log, GINT_TO_POINTER(away_msgs),
GINT_TO_POINTER(away_filepos));
log_close(log);