From: Julian Andres Klode Date: Wed, 10 Aug 2016 14:19:00 +0000 (+0200) Subject: Merge branch 'cmake' X-Git-Tag: 1.3_rc1~9 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/e02c3a9ec2b2f7a8d4aecd70f2ecdae27c207aa9?ds=inline;hp=-c Merge branch 'cmake' --- e02c3a9ec2b2f7a8d4aecd70f2ecdae27c207aa9 diff --combined apt-pkg/deb/dpkgpm.cc index 6aa1ce426,ccfc77d6a..3d0fd622c --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@@ -403,7 -403,6 +403,7 @@@ bool pkgDPkgPM::SendPkgsInfo(FILE * con bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf) { bool result = true; + static bool interrupted = false; Configuration::Item const *Opts = _config->Tree(Cnf); if (Opts == 0 || Opts->Child == 0) @@@ -411,9 -410,6 +411,9 @@@ Opts = Opts->Child; sighandler_t old_sigpipe = signal(SIGPIPE, SIG_IGN); + sighandler_t old_sigint = signal(SIGINT, [](int signum){ + interrupted = true; + }); unsigned int Count = 1; for (; Opts != 0; Opts = Opts->Next, Count++) @@@ -512,12 -508,8 +512,12 @@@ break; } } + signal(SIGINT, old_sigint); signal(SIGPIPE, old_sigpipe); + if (interrupted) + result = _error->Error("Interrupted"); + return result; } /*}}}*/ @@@ -1094,7 -1086,7 +1094,7 @@@ void pkgDPkgPM::StartPtyMagic() /* _error->Errno("unlockpt", "Unlocking the slave of master fd %d failed!", d->master); else { - #ifdef HAVE_PTS_NAME_R + #ifdef HAVE_PTSNAME_R char slave_name[64]; // 64 is used by bionic if (ptsname_r(d->master, slave_name, sizeof(slave_name)) != 0) #else