]> git.saurik.com Git - apt.git/commitdiff
* merged from dpkg-log branch
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 28 Aug 2007 08:02:45 +0000 (10:02 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 28 Aug 2007 08:02:45 +0000 (10:02 +0200)
1  2 
apt-pkg/deb/dpkgpm.cc

diff --combined apt-pkg/deb/dpkgpm.cc
index 8eddc04ca8d01981aac9ee5ac76b65157534b3b7,343e3d82f7b0fb2cc016773a6e0ae940c1b8014a..bb7e4b40a8c62f7c35aa664d6d8cfe8acf6e3930
@@@ -44,8 -44,7 +44,8 @@@ using namespace std
  // ---------------------------------------------------------------------
  /* */
  pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) 
 -   : pkgPackageManager(Cache), dpkgbuf_pos(0), PackagesTotal(0), PackagesDone(0)
 +   : pkgPackageManager(Cache), dpkgbuf_pos(0), PackagesDone(0), 
 +     PackagesTotal(0), term_out(NULL)
  {
  }
                                                                        /*}}}*/
@@@ -352,7 -351,7 +352,7 @@@ void pkgDPkgPM::DoStdin(int master
  /*
   * read the terminal pty and write log
   */
 -void pkgDPkgPM::DoTerminalPty(int master, FILE *term_out)
 +void pkgDPkgPM::DoTerminalPty(int master)
  {
     char term_buf[1024] = {0,};
  
@@@ -568,6 -567,7 +568,6 @@@ bool pkgDPkgPM::Go(int OutStatusFd
        return _error->Error(_("Directory '%s' missing"), logdir.c_str());
     string logfile_name = flCombine(logdir,
                                   _config->Find("Dir::Log::Terminal"));
 -   FILE *term_out = NULL;
     if (!logfile_name.empty())
     {
        term_out = fopen(logfile_name.c_str(),"a");
        int _dpkgin = fd[0];
        close(fd[1]);                        // close the write end of the pipe
  
 -      // the read buffers for the communication with dpkg
 -      char buf[2] = {0,0};
 -      
        // the result of the waitpid call
        int res;
        if(slave > 0)
         tv.tv_sec = 1;
         tv.tv_usec = 0;
         select_ret = select(max(master, _dpkgin)+1, &rfds, NULL, NULL, &tv);
-        if (select_ret < 0)
+        if (select_ret < 0) {
            std::cerr << "Error in select()" << std::endl;
-        else if (select_ret == 0)
+           continue;
+        } else if (select_ret == 0)
            continue;
  
         if(master >= 0 && FD_ISSET(master, &rfds))
 -          DoTerminalPty(master, term_out);
 +          DoTerminalPty(master);
         if(master >= 0 && FD_ISSET(0, &rfds))
            DoStdin(master);
         if(FD_ISSET(_dpkgin, &rfds))