diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2020-12-14 19:10:17 +0200 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2020-12-18 17:06:38 +0200 |
commit | c773fd297abd5ae0f5bc1148c289f41066bf3fd8 (patch) | |
tree | e4248e97e095eeda5c5bf4af74f5220db161259d /src/corelib/io/qprocess_unix.cpp | |
parent | f2d22d5a5126e7a73da620a60847fc124f724333 (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.cpp | 5 |
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 { |