terminate when command called by system() got SIGINT or SIGQUIT

sync up with qmake - this doesn't actually do anything in qtc.

Change-Id: I5e5df9f6d136601f0f36a8d645f90a1cab9995ad
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from qtbase/f8ef7e1d2619e6d394c57561bb275767f0517b24)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Oswald Buddenhagen
2016-07-14 18:10:50 +02:00
parent e1cee308a9
commit fb9e43ba44

View File

@@ -54,6 +54,8 @@
#include <utime.h> #include <utime.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#else #else
@@ -1498,9 +1500,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
runProcess(&proc, args.at(0).toQString(m_tmp2)); runProcess(&proc, args.at(0).toQString(m_tmp2));
return returnBool(proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0); return returnBool(proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0);
#else #else
return returnBool(system((QLatin1String("cd ") int ec = system((QLatin1String("cd ")
+ IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory())) + IoUtils::shellQuote(QDir::toNativeSeparators(currentDirectory()))
+ QLatin1String(" && ") + args.at(0)).toLocal8Bit().constData()) == 0); + 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 #endif
#else #else
return ReturnTrue; return ReturnTrue;