summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-12-14 19:10:17 +0200
committerAlex Trotsenko <alex1973tr@gmail.com>2020-12-18 17:06:38 +0200
commitc773fd297abd5ae0f5bc1148c289f41066bf3fd8 (patch)
treee4248e97e095eeda5c5bf4af74f5220db161259d /src/corelib/io/qprocess_unix.cpp
parentf2d22d5a5126e7a73da620a60847fc124f724333 (diff)
QProcess/Unix: speed up initialization of write notifier
By using new QSocketNotifier API, we can avoid unnecessarily enabling the notifier right before turning it off again. Change-Id: Ie0dea00251e9885653677c495dfc5abaaa4db1c7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index cc753541a2..07d427047d 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -259,9 +259,8 @@ bool QProcessPrivate::openChannel(Channel &channel)
// create the socket notifiers
if (threadData.loadRelaxed()->hasEventDispatcher()) {
if (&channel == &stdinChannel) {
- channel.notifier = new QSocketNotifier(channel.pipe[1],
- QSocketNotifier::Write, q);
- channel.notifier->setEnabled(false);
+ channel.notifier = new QSocketNotifier(QSocketNotifier::Write, q);
+ channel.notifier->setSocket(channel.pipe[1]);
QObject::connect(channel.notifier, SIGNAL(activated(QSocketDescriptor)),
q, SLOT(_q_canWrite()));
} else {