We were accidentally closing it along with all the other file
descriptors if the CloseFileDescriptors flag was active. That meant we
were unable to report start problems back to the parent process.
So instead of closing everything immediately, we simply mark everything
as FD_CLOEXEC so they'll be closed by execve()'s success. Because we're
using CLOSE_RANGE_CLOEXEC now to detect the system call, we don't need
the configure-time test.
[ChangeLog][QtCore][QProcess] Fixed a bug that caused QProcess not to
report start failures if the UnixProcessFlag::CloseFileDescriptors flag
was active.
Change-Id: I4d81d763281354e886d9fffd56ef6ab8b6115715
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 3d007ff2e9caf328f92d65f71a94fd869552b1b6)
(cherry picked from commit 01010851cb61f5d7964ba2317defb67cdfcb72f5)