]> git.ipfire.org Git - thirdparty/systemd.git/commit
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)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)
commitff0e7e05c9904b4120868e96216b123c1b798aa4
treedd76fba9a62135d4b0356cbc6d654b22b8148a60
parent9dd1b1e8694c3cbfaf64bc9d93ff6e7a61694a49
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