]> git.saurik.com Git - apt.git/commit - apt-pkg/contrib/fileutl.cc
CopyFile: avoid failing on EOF on some systems
authorPino Toscano <pino@debian.org>
Sat, 19 Dec 2015 11:06:53 +0000 (12:06 +0100)
committerJulian Andres Klode <jak@debian.org>
Sat, 19 Dec 2015 11:52:45 +0000 (12:52 +0100)
commitc0b271edc2f6d9e5dea5ac82fbc911f0e3adfa7a
tree72ed60fb4f13f1d4c533d79dd7faf902a36f36e9
parent0c93e388d417ab03f2857903bb5791f4312cdbd0
CopyFile: avoid failing on EOF on some systems

On EOF, ToRead will be 0, which might trigger on some systems (e.g.
on the Hurd) an error due to the invalid byte count passed to write().
The whole loop already checks for ToRead != 0, so perform the writing
step only when there was actual data read.

Closes: #808381
apt-pkg/contrib/fileutl.cc