chiark / gitweb /
fileio: try to read one byte too much in read_full_stream()
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)
commitacd34fa3f200bd4c4caccc7973425d434fb1ec97
tree542005bd0b41e481a89ffbc7987761a78b8a4a2c
parentc95480b3cff1bae5f2feab1ab3cbca79277908fa
fileio: try to read one byte too much in read_full_stream()

Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().

This is a minor optimization, and replaces #3908.
src/basic/fileio.c