Description
For example when starting a process with a non-existant binary:
QProcess proc;
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
proc.start("foo");
proc.waitForFinished();
qDebug() << proc.error() << proc.exitStatus() << proc.exitCode() << proc.errorString();
Without the Flag this prints:
QProcess::FailedToStart QProcess::NormalExit 255 "Child process set up failed: execve: No such file or directory"
And with it:
QProcess::UnknownError QProcess::NormalExit 255 "Unknown error"
As the error is not set, also the errorOccured signal is not sent in the scenario with the flag set.
I took a look at the sources and it looks like the FailedToStart error and concrete code is communicated via a pipe from the forked process to the original process and the ProcessFlag also closes that pipe. I guess this also affects other scenarios as well but didn't investigate further.