X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7d8afa391c5cd04e797a2b41fe3b946631254995..eec898ad83d383f27b94f747245fe82fe11949b0:/apt-pkg/acquire-worker.cc diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 099a43e2e..2ec8f1bd8 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-worker.cc,v 1.19 1999/01/30 08:08:54 jgg Exp $ +// $Id: acquire-worker.cc,v 1.21 1999/04/20 05:02:09 jgg Exp $ /* ###################################################################### Acquire Worker @@ -24,9 +24,11 @@ #include #include +#include #include #include #include +#include /*}}}*/ // Worker::Worker - Constructor for Queue startup /*{{{*/ @@ -113,12 +115,7 @@ bool pkgAcquire::Worker::Start() SetCloseExec(Pipes[0],true); // Fork off the process - Process = fork(); - if (Process < 0) - { - cerr << "FATAL -> Failed to fork." << endl; - exit(100); - } + Process = ExecFork(); // Spawn the subprocess if (Process == 0) @@ -433,7 +430,13 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) /* */ bool pkgAcquire::Worker::OutFdReady() { - int Res = write(OutFd,OutQueue.begin(),OutQueue.length()); + int Res; + do + { + Res = write(OutFd,OutQueue.begin(),OutQueue.length()); + } + while (Res < 0 && errno == EINTR); + if (Res <= 0) return MethodFailure();