summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2021-05-31 17:30:53 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2021-05-31 21:50:07 +0300
commit64d6003f498d7259325719daba021d86d8deda95 (patch)
tree04727340dce1484ce044f6df1d17cada00e95a66 /src/corelib/io/qprocess.cpp
parent86542054d035c43f926eeb96b517108eb825831e (diff)
Introduce QProcessPrivate::closeChannels()
Avoid duplicating code for both platforms. Change-Id: Iae00023672b63e8539cf824fa3aaaff2bf9ae0c5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 16fb2be0aee..878f52fd004 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -834,9 +834,7 @@ void QProcessPrivate::cleanup()
delete stateNotifier;
stateNotifier = nullptr;
}
- closeChannel(&stdoutChannel);
- closeChannel(&stderrChannel);
- closeChannel(&stdinChannel);
+ closeChannels();
destroyPipe(childStartedPipe);
#ifdef Q_OS_UNIX
if (forkfd != -1)
@@ -926,6 +924,16 @@ bool QProcessPrivate::openChannels()
/*!
\internal
*/
+void QProcessPrivate::closeChannels()
+{
+ closeChannel(&stdoutChannel);
+ closeChannel(&stderrChannel);
+ closeChannel(&stdinChannel);
+}
+
+/*!
+ \internal
+*/
bool QProcessPrivate::openChannelsForDetached()
{
// stdin channel.