summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-05-22 16:14:34 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-05-22 16:45:40 (GMT)
commitdacc8cb0b2abd5ec3e9603c9bcf5b8f489639404 (patch)
treea23ff859cb6579899e8d09fc3cbfbbaa1f241a87 /src/corelib/io
parentbbf3361d42c85d9da712e0261ecc87d62a29e403 (diff)
downloadQt-dacc8cb0b2abd5ec3e9603c9bcf5b8f489639404.zip
Qt-dacc8cb0b2abd5ec3e9603c9bcf5b8f489639404.tar.gz
Qt-dacc8cb0b2abd5ec3e9603c9bcf5b8f489639404.tar.bz2
Reorganise the pipe creation code.
Put all pipe creation calls together. Reviewed-by: Oswald Buddenhagen
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qprocess_unix.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index b06e217..e87c314 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -580,29 +580,27 @@ void QProcessPrivate::startProcess()
processManager()->start();
// Initialize pipes
+ if (!createChannel(stdinChannel) ||
+ !createChannel(stdoutChannel) ||
+ !createChannel(stderrChannel))
+ return;
qt_create_pipe(childStartedPipe);
+ qt_create_pipe(deathPipe);
+ ::fcntl(deathPipe[0], F_SETFD, FD_CLOEXEC);
+ ::fcntl(deathPipe[1], F_SETFD, FD_CLOEXEC);
+
if (threadData->eventDispatcher) {
startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],
QSocketNotifier::Read, q);
QObject::connect(startupSocketNotifier, SIGNAL(activated(int)),
q, SLOT(_q_startupNotification()));
- }
- qt_create_pipe(deathPipe);
- ::fcntl(deathPipe[0], F_SETFD, FD_CLOEXEC);
- ::fcntl(deathPipe[1], F_SETFD, FD_CLOEXEC);
- if (threadData->eventDispatcher) {
deathNotifier = new QSocketNotifier(deathPipe[0],
QSocketNotifier::Read, q);
QObject::connect(deathNotifier, SIGNAL(activated(int)),
q, SLOT(_q_processDied()));
}
- if (!createChannel(stdinChannel) ||
- !createChannel(stdoutChannel) ||
- !createChannel(stderrChannel))
- return;
-
// Start the process (platform dependent)
q->setProcessState(QProcess::Starting);