summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-05 17:13:24 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-05 17:13:24 +0200
commitb4278cc96fa0184b4f522e2bcfe82bd8eba93595 (patch)
tree59969ad6463918810ca264854615e8b2cfdf0bad /apt-pkg/deb/dpkgpm.cc
parentf3594b9de99745c84563bac3ef59a159e30d4cd8 (diff)
parent3fa4e98f62e469f4292d2811b4e15f4afb678fbd (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: configure.ac debian/apt.dirs debian/changelog
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c52b83c6e..e410594df 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1053,14 +1053,15 @@ void pkgDPkgPM::StartPtyMagic()
}
// setup the pty and stuff
- struct winsize win;
+ struct winsize win;
- // if tcgetattr does not return zero there was a error
- // and we do not do any pty magic
+ // if tcgetattr for both stdin/stdout returns 0 (no error)
+ // we do the pty magic
_error->PushToStack();
- if (tcgetattr(STDOUT_FILENO, &d->tt) == 0)
+ if (tcgetattr(STDIN_FILENO, &d->tt) == 0 &&
+ tcgetattr(STDOUT_FILENO, &d->tt) == 0)
{
- if (ioctl(1, TIOCGWINSZ, (char *)&win) < 0)
+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&win) < 0)
{
_error->Errno("ioctl", _("ioctl(TIOCGWINSZ) failed"));
} else if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0)