]> git.saurik.com Git - apt.git/commit - apt-pkg/contrib/fileutl.cc
BufferedFileFdPrivate: Make InternalFlush() save against errors
authorJulian Andres Klode <jak@debian.org>
Mon, 28 Dec 2015 21:30:44 +0000 (22:30 +0100)
committerJulian Andres Klode <jak@debian.org>
Mon, 28 Dec 2015 21:30:44 +0000 (22:30 +0100)
commit1f5062f656b4919ff1d3126c413c40e53fdd1ab2
treed735762c50362885f47b8982207780c825580883
parent1a3296c0bd67c46c6ff791345b6101edcb97e778
BufferedFileFdPrivate: Make InternalFlush() save against errors

Previously, if flush errored inside the loop, data could have
already been written to the wrapped descriptor without having
been removed from the buffer.

Also try to work around EINTR here. A better solution might be
to have the individual privates detect an interrupt and return
0 in such a case, instead of relying on errno being untouched
in between the syscall and the return from InternalWrite.
apt-pkg/contrib/fileutl.cc