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>
This commit is contained in:
parent
08a908c549
commit
f8ef7e1d26
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user