]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
newer gcc versions seems to have no problem with that, but while working
[apt.git] / apt-pkg / acquire-worker.cc
index 3bb977e1403f42a3920463f771f0a956024e9200..77e2fc3119d5c430effb8940569c6015ac0cb96f 100644 (file)
@@ -431,7 +431,9 @@ bool pkgAcquire::Worker::MediaChange(string Message)
             << Drive  << ":"     // drive
             << msg.str()         // l10n message
             << endl;
-      write(status_fd, status.str().c_str(), status.str().size());
+
+      std::string const dlstatus = status.str();
+      FileFd::Write(status_fd, dlstatus.c_str(), dlstatus.size());
    }
 
    if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),
@@ -530,17 +532,10 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item)
 /* */
 bool pkgAcquire::Worker::OutFdReady()
 {
-   int Res;
-   do
-   {
-      Res = write(OutFd,OutQueue.c_str(),OutQueue.length());
-   }
-   while (Res < 0 && errno == EINTR);
-   
-   if (Res <= 0)
+   if (FileFd::Write(OutFd,OutQueue.c_str(),OutQueue.length()) == false)
       return MethodFailure();
    
-   OutQueue.erase(0,Res);
+   OutQueue.clear();
    if (OutQueue.empty() == true)
       OutReady = false;