summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-05-22 18:14:34 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-05-22 18:45:40 +0200
commitdacc8cb0b2abd5ec3e9603c9bcf5b8f489639404 (patch)
treea23ff859cb6579899e8d09fc3cbfbbaa1f241a87 /src/corelib/io/qprocess_unix.cpp
parentbbf3361d42c85d9da712e0261ecc87d62a29e403 (diff)
Reorganise the pipe creation code.
Put all pipe creation calls together. Reviewed-by: Oswald Buddenhagen
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-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 b06e2172cb..e87c3144ed 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);