Forward and log exit code of the nested process
ClosedPublic

Authored by apol on May 28 2019, 4:43 PM.

Details

Summary

Otherwise it's hard to tell if it failed.

Test Plan

Found out that my session was crashing.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.May 28 2019, 4:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 28 2019, 4:43 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
apol requested review of this revision.May 28 2019, 4:43 PM
zzag added a subscriber: zzag.May 28 2019, 6:53 PM
zzag added inline comments.
main_wayland.cpp
251–254

From QProcess::exitCode documentation:

This value is not valid unless exitStatus() returns NormalExit.

Perhaps, we need to do something like this

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);
apol updated this revision to Diff 58846.May 29 2019, 2:38 PM

Don't expose the code when crashing

zzag accepted this revision.May 29 2019, 2:55 PM
This revision is now accepted and ready to land.May 29 2019, 2:55 PM
This revision was automatically updated to reflect the committed changes.