Commit fb9e43ba authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

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's avatarLars Knoll <lars.knoll@qt.io>
(cherry picked from qtbase/f8ef7e1d2619e6d394c57561bb275767f0517b24)
Reviewed-by: Jake Petroules's avatarJake Petroules <jake.petroules@qt.io>
parent e1cee308
......@@ -54,6 +54,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
......@@ -1498,9 +1500,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment