From a416a90b631a430306df6ed3fa1d4f3a1bdc7949 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 27 Nov 2015 12:07:48 +0100 Subject: Deal with killed acquire methods properly instead of hanging This fixes a regression caussed by commit 95278287f4e1eeaf5d96749d6fc9bfc53fb400d0 that moved the error detection of RunFds() later into the loop. However this broke detecting issues like dead acquire methods. Instead of relying on the global error state (which is bad) we now pass a boolean value back from RunFds() and break on false. Closes: #806406 --- apt-pkg/acquire.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apt-pkg/acquire.h') diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 3e5ca41cd..f4019d556 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -236,8 +236,15 @@ class pkgAcquire * * \param WSet The set of file descriptors that are ready for * output. + * + * \return false if there is an error condition on one of the fds */ - virtual void RunFds(fd_set *RSet,fd_set *WSet); + bool RunFdsSane(fd_set *RSet,fd_set *WSet); + + // just here for compatbility, needs to be removed on the next + // ABI/API break. RunFdsSane() is what should be used as it + // returns if there is an error condition on one of the fds + virtual void RunFds(fd_set *RSet,fd_set *WSet); /** \brief Check for idle queues with ready-to-fetch items. * -- cgit v1.2.3