diff options
-rw-r--r-- | apt-pkg/acquire.cc | 21 | ||||
-rw-r--r-- | apt-pkg/acquire.h | 9 |
2 files changed, 24 insertions, 6 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index e61f4192d..a86bcef1a 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -428,20 +428,30 @@ void pkgAcquire::SetFds(int &Fd,fd_set *RSet,fd_set *WSet) } } /*}}}*/ -// Acquire::RunFds - Deal with active FDs /*{{{*/ +// Acquire::RunFds - compatibility remove on next abi/api break /*{{{*/ +void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet) +{ + RunFdsSane(RSet, WSet); +}; + /*}}}*/ +// Acquire::RunFdsSane - Deal with active FDs /*{{{*/ // --------------------------------------------------------------------- /* Dispatch active FDs over to the proper workers. It is very important that a worker never be erased while this is running! The queue class should never erase a worker except during shutdown processing. */ -void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet) +bool pkgAcquire::RunFdsSane(fd_set *RSet,fd_set *WSet) { + bool Res = true; + for (Worker *I = Workers; I != 0; I = I->NextAcquire) { if (I->InFd >= 0 && FD_ISSET(I->InFd,RSet) != 0) - I->InFdReady(); + Res &= I->InFdReady(); if (I->OutFd >= 0 && FD_ISSET(I->OutFd,WSet) != 0) - I->OutFdReady(); + Res &= I->OutFdReady(); } + + return Res; } /*}}}*/ // Acquire::Run - Run the fetch sequence /*{{{*/ @@ -604,7 +614,8 @@ pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall) break; } - RunFds(&RFds,&WFds); + if(RunFdsSane(&RFds,&WFds) == false) + break; // Timeout, notify the log class if (Res == 0 || (Log != 0 && Log->Update == true)) 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. * |