diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-08-06 15:41:32 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-08-06 15:41:32 +0200 |
commit | 1ba381717c81d4a06091ab1ededf70af55801b19 (patch) | |
tree | 81d037a4e74a5023a4591cbf8102e417cd200229 /apt-pkg | |
parent | 917832191acb189705762e13aab3b7c5e6e26653 (diff) |
* apt-pkg/deb/dpkgpm.{cc,h}:
move term_out into DPkgPM class
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 8 | ||||
-rw-r--r-- | apt-pkg/deb/dpkgpm.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index e017c1a5b..8eddc04ca 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -44,7 +44,8 @@ using namespace std; // --------------------------------------------------------------------- /* */ pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) - : pkgPackageManager(Cache), dpkgbuf_pos(0), PackagesDone(0), PackagesTotal(0) + : pkgPackageManager(Cache), dpkgbuf_pos(0), PackagesDone(0), + PackagesTotal(0), term_out(NULL) { } /*}}}*/ @@ -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,}; @@ -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"); @@ -816,7 +816,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) 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)) diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index 065c6c917..448091626 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -26,7 +26,8 @@ class pkgDPkgPM : public pkgPackageManager // the buffer we use for the dpkg status-fd reading char dpkgbuf[1024]; int dpkgbuf_pos; - + FILE *term_out; + protected: // progress reporting @@ -67,7 +68,7 @@ class pkgDPkgPM : public pkgPackageManager // input processing void DoStdin(int master); - void DoTerminalPty(int master, FILE *out); + void DoTerminalPty(int master); void DoDpkgStatusFd(int statusfd, int OutStatusFd); void ProcessDpkgStatusLine(int OutStatusFd, char *line); |