mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04: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:
parent
acbe2ecac2
commit
db5ae4adce
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user