summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 573a85c2f..19bcca8a1 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -872,7 +872,23 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
<< ":" << (CurrentBytes/float(TotalBytes)*100.0)
<< ":" << msg
<< endl;
- write(fd, status.str().c_str(), status.str().size());
+
+ std::string const dlstatus = status.str();
+ size_t done = 0;
+ size_t todo = dlstatus.size();
+ errno = 0;
+ int res = 0;
+ do
+ {
+ res = write(fd, dlstatus.c_str() + done, todo);
+ if (res < 0 && errno == EINTR)
+ continue;
+ if (res < 0)
+ break;
+ done += res;
+ todo -= res;
+ }
+ while (res > 0 && todo > 0);
}
return true;