summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-05 16:03:03 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-05 16:03:03 +0200
commit98c934f2723d63d00908803ad47ab1359081ec2d (patch)
treedf7c21f028089b99d63289d784ee5bd23d54d380 /apt-pkg/deb
parenta298a1dc595c548e6c10b48b8e69d987e5be1c42 (diff)
parenta11f6c973bc0dc226d8953e3edb6333d526c3143 (diff)
Merge remote-tracking branch 'upstream/debian/sid' into debian/sid
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/dpkgpm.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c3e7e1d1d..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)
@@ -1617,7 +1618,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
string::size_type pos;
FILE *report;
- if (_config->FindB("Dpkg::ApportFailureReport", false) == false)
+ if (_config->FindB("Dpkg::ApportFailureReport", true) == false)
{
std::clog << "configured to not write apport reports" << std::endl;
return;