Handle partial reads and errors in package IO (RhBug:802839, RhBug:580974)
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 30 Oct 2012 09:36:56 +0000 (11:36 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 7 Dec 2012 12:22:53 +0000 (14:22 +0200)
commitd6ea9a50d76be3878b4bb7ccf6696549b9988fa0
tree5dc20430a50d069bd1bd56c058e7d7125b996675
parent7a152a595685c196a716c6ed5405c74abdba1812
Handle partial reads and errors in package IO (RhBug:802839, RhBug:580974)

- There are no guarantees Fread() will return all of the requested size:
  it can return partial data eg on signals and pipe descriptors. Introduce
  a helper function to handle this centrally for all package read IO,
  effectively reintroducing timedRead() but without the caveats:
  timedRead() did not work on compressed streams, did not handle
  eg EINTR correctly and while really being an internal helper,
  was exported in the API.
(cherry picked from commit cbd6ef58bbc122e6adf2138679915bd3845d6756)
lib/header.c
lib/header_internal.h
lib/package.c
lib/rpmlead.c
lib/signature.c