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/D21465
remotes/origin/fredrik/swap-event-wip
Aleix Pol 7 years ago
parent 835f3dfde9
commit cd7fae95a4
  1. 14
      main_wayland.cpp

@ -247,7 +247,19 @@ void ApplicationWayland::startSession()
p->setProcessChannelMode(QProcess::ForwardedErrorChannel);
p->setProcessEnvironment(processStartupEnvironment());
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);
}
// start the applications passed to us as command line arguments

Loading…
Cancel
Save