summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-04-11 13:25:28 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-04-11 13:25:28 +0200
commitd68d65ad637526e46ea77ab83e07470d26df15fc (patch)
tree0873a85635b7940842fa4d31898895f3618155b8 /apt-pkg/acquire.cc
parent3b4d8136e78b9f2a70431ece4c850861d90e8bb1 (diff)
use a static FileFd::Write overload to reduce duplication of write()-retry code
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc16
1 files changed, 1 insertions, 15 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 19bcca8a1..5e1419056 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -874,21 +874,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
<< endl;
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);
+ FileFd::Write(fd, dlstatus.c_str(), dlstatus.size());
}
return true;