]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-worker.cc
the previously used VERSION didn't work everywhere so we are switching
[apt.git] / apt-pkg / acquire-worker.cc
index 3bb977e1403f42a3920463f771f0a956024e9200..d79b2b16dfb22c3021ebda26ecbbcf4de204420c 100644 (file)
@@ -431,7 +431,23 @@ 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();
+      size_t done = 0;
+      size_t todo = dlstatus.size();
+      errno = 0;
+      int res = 0;
+      do
+      {
+        res = write(status_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);
    }
 
    if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),