Commit 3b729128 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Forcefully update file size if read data past the former end of it

Maybe we could call fstat() at every read anyway? While a file is open,
the operating system is extremely likely to have its meta data cached.
parent 2c87bceb
......@@ -235,8 +235,8 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
p_sys->i_nb_reads++;
#ifdef HAVE_SYS_STAT_H
if( p_access->info.i_size != 0 &&
(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS) == 0 )
if ((p_access->info.i_size && !(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS))
|| (p_access->info.i_pos > p_access->info.i_size))
{
struct stat st;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment