mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-15 06:20:41 +00:00
Bug 1575974 - Report any non-zero exit code as a process failure in nsIProcess r=gsvelto
EXIT_FAILURE is 'implementation defined' but can be defined to be 1. In our case, pingsender exits with EXIT_FAILURE but nsIProcess wasn't reporting it as failure because it thought failures were always negative. Differential Revision: https://phabricator.services.mozilla.com/D45038 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
6ba489874b
commit
be6c896158
@ -65,7 +65,7 @@ function runMinidumpAnalyzer(minidumpPath, allThreads) {
|
||||
break;
|
||||
case "process-failed":
|
||||
gRunningProcesses.delete(process);
|
||||
reject();
|
||||
resolve();
|
||||
break;
|
||||
default:
|
||||
reject(new Error("Unexpected topic received " + topic));
|
||||
|
@ -130,7 +130,7 @@ function test_notify_blocking() {
|
||||
process.runAsync([], 0, {
|
||||
observe(subject, topic, data) {
|
||||
process = subject.QueryInterface(Ci.nsIProcess);
|
||||
Assert.equal(topic, "process-finished");
|
||||
Assert.equal(topic, "process-failed");
|
||||
Assert.equal(process.exitValue, 42);
|
||||
test_notify_nonblocking();
|
||||
},
|
||||
@ -164,7 +164,7 @@ function test_notify_killed() {
|
||||
process.runAsync([], 0, {
|
||||
observe(subject, topic, data) {
|
||||
process = subject.QueryInterface(Ci.nsIProcess);
|
||||
Assert.equal(topic, "process-finished");
|
||||
Assert.equal(topic, "process-failed");
|
||||
do_test_finished();
|
||||
},
|
||||
});
|
||||
|
@ -312,7 +312,7 @@ void nsProcess::ProcessComplete() {
|
||||
}
|
||||
|
||||
const char* topic;
|
||||
if (mExitValue < 0) {
|
||||
if (mExitValue != 0) {
|
||||
topic = "process-failed";
|
||||
} else {
|
||||
topic = "process-finished";
|
||||
|
Loading…
x
Reference in New Issue
Block a user