QProcess/Unix: allow startDetached() to also use vfork()
The same arguments that applied to the regular process-starting code in commit e1a787a76ed462e4ed49db78a40c6d7e272182d7 (6.4) apply here too. Task-number: QTBUG-104493 Change-Id: Icfe44ecf285a480fafe4fffd174da1b05d0054bc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
parent
815bb2a4fb
commit
c5c7712910
@ -1090,7 +1090,12 @@ bool QProcessPrivate::startDetached(qint64 *pid)
|
||||
// see startProcess() for more information
|
||||
PThreadCancelGuard cancelGuard;
|
||||
|
||||
pid_t childPid = fork();
|
||||
auto doFork = [this]() {
|
||||
if (useForkFlags(unixExtras.get()))
|
||||
return fork;
|
||||
QT_IGNORE_DEPRECATIONS(return vfork;)
|
||||
}();
|
||||
pid_t childPid = doFork();
|
||||
if (childPid == 0) {
|
||||
::signal(SIGPIPE, SIG_DFL); // reset the signal that we ignored
|
||||
::setsid();
|
||||
@ -1105,7 +1110,7 @@ bool QProcessPrivate::startDetached(qint64 *pid)
|
||||
::_exit(1);
|
||||
};
|
||||
|
||||
pid_t doubleForkPid = fork();
|
||||
pid_t doubleForkPid = doFork();
|
||||
if (doubleForkPid == 0) {
|
||||
// Render channels configuration.
|
||||
commitChannels();
|
||||
|
Loading…
x
Reference in New Issue
Block a user