Killed ChildProcess::ActiveProcess exit code

If a ChildProcess is killed using something like kill (getpid(), SIGKILL), what should be the exit code of that process?

At the moment, it returns 0 because the process isn’t around anymore so this doesn’t complete, the returned pid is 0:

            auto pid = waitpid (childPID, &childState, WNOHANG);

so the exit code is returned as the default 0.

I’m just wondering if this is correct or if this kind of exiting should be picked up either as the SIGKILL or something like -1?

I think this is a mistake in JUCE.

If a ChildProcess is killed using something like kill (getpid(), SIGKILL), what should be the exit code of that process?

That process doesn’t have an exit code so the result of getExitCode isn’t meaningful. ChildProcess should probably have a method indicating that it signaled though, or a more meaningful type with a method like getExitStatus().

The Rust standard library is a good example of this.

Alternatively they could return -signal which avoids ambiguity with real return codes.

Yeah, I’d settle for this. Anything non-zero would let me know it hasn’t exited “cleanly”.