diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-14 18:10:50 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-21 15:36:20 +0000 |
commit | f8ef7e1d2619e6d394c57561bb275767f0517b24 (patch) | |
tree | cbc7d148c8ae003d02f50b1644a884bea7551d4b | |
parent | 08a908c549e455a9443ca1594fe6ad9e938ea1fa (diff) |
terminate when command called by system() got SIGINT or SIGQUIT
these are the two signals unhelpfully suppressed by system(2).
Change-Id: I5e5df9f6d136601f0f36a8d645f90a1cab9995ad
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | qmake/library/qmakebuiltins.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index c1d23295e7..9fc6603075 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -62,6 +62,8 @@ #include <utime.h> #include <errno.h> #include <unistd.h> +#include <signal.h> +#include <sys/wait.h> #include <sys/stat.h> #include <sys/utsname.h> #else @@ -1504,9 +1506,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( runProcess(&proc, args.at(0).toQString(m_tmp2)); return returnBool(proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0); #else - return returnBool(system((QLatin1String("cd ") - + IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory())) - + QLatin1String(" && ") + args.at(0)).toLocal8Bit().constData()) == 0); + int ec = system((QLatin1String("cd ") + + IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory())) + + QLatin1String(" && ") + args.at(0)).toLocal8Bit().constData()); +# ifdef Q_OS_UNIX + if (ec != -1 && WIFSIGNALED(ec) && (WTERMSIG(ec) == SIGQUIT || WTERMSIG(ec) == SIGINT)) + raise(WTERMSIG(ec)); +# endif + return returnBool(ec == 0); #endif #else return ReturnTrue; |