Forward and log exit code of the nested process
Summary: Otherwise it's hard to tell if it failed. Test Plan: Found out that my session was crashing. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D21465icc-effect-5.17.5
parent
835f3dfde9
commit
cd7fae95a4
|
@ -247,7 +247,19 @@ void ApplicationWayland::startSession()
|
||||||
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
|
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
|
||||||
p->setProcessEnvironment(processStartupEnvironment());
|
p->setProcessEnvironment(processStartupEnvironment());
|
||||||
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
|
auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
|
||||||
connect(p, finishedSignal, this, &ApplicationWayland::quit);
|
connect(p, finishedSignal, this, [](int code, QProcess::ExitStatus status) {
|
||||||
|
if (status == QProcess::CrashExit) {
|
||||||
|
qWarning() << "Session process has crashed";
|
||||||
|
QCoreApplication::exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code) {
|
||||||
|
qWarning() << "Session process exited with code" << code;
|
||||||
|
}
|
||||||
|
|
||||||
|
QCoreApplication::exit(code);
|
||||||
|
});
|
||||||
p->start(m_sessionArgument);
|
p->start(m_sessionArgument);
|
||||||
}
|
}
|
||||||
// start the applications passed to us as command line arguments
|
// start the applications passed to us as command line arguments
|
||||||
|
|
Loading…
Reference in New Issue