Diffstat (limited to 'core/launcher/qprocess_unix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/qprocess_unix.cpp | 93 |
1 files changed, 46 insertions, 47 deletions
diff --git a/core/launcher/qprocess_unix.cpp b/core/launcher/qprocess_unix.cpp index 19a8c93..d62e4e6 100644 --- a/core/launcher/qprocess_unix.cpp +++ b/core/launcher/qprocess_unix.cpp | |||
@@ -20,4 +20,2 @@ | |||
20 | 20 | ||
21 | //#include "qplatformdefs.h" | ||
22 | |||
23 | // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. | 21 | // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. |
@@ -29,10 +27,14 @@ | |||
29 | 27 | ||
30 | #ifndef QT_NO_PROCESS | 28 | /* OPIE */ |
29 | #include <opie2/odebug.h> | ||
30 | using namespace Opie::Core; | ||
31 | 31 | ||
32 | #include "qapplication.h" | 32 | /* QT */ |
33 | #include "qqueue.h" | 33 | #ifndef QT_NO_PROCESS |
34 | #include "qlist.h" | 34 | #include <qapplication.h> |
35 | #include "qsocketnotifier.h" | 35 | #include <qqueue.h> |
36 | #include "qtimer.h" | 36 | #include <qlist.h> |
37 | #include "qregexp.h" | 37 | #include <qsocketnotifier.h> |
38 | #include <qtimer.h> | ||
39 | #include <qregexp.h> | ||
38 | 40 | ||
@@ -40,5 +42,4 @@ | |||
40 | 42 | ||
43 | /* STD */ | ||
41 | #include <stdlib.h> | 44 | #include <stdlib.h> |
42 | |||
43 | // ### FOR Qt 2.3 compat | ||
44 | #include <unistd.h> | 45 | #include <unistd.h> |
@@ -49,5 +50,4 @@ | |||
49 | #include <sys/fcntl.h> | 50 | #include <sys/fcntl.h> |
50 | 51 | #include <sys/resource.h> | |
51 | #include <errno.h> | 52 | #include <errno.h> |
52 | |||
53 | #ifdef Q_OS_MACX | 53 | #ifdef Q_OS_MACX |
@@ -55,3 +55,2 @@ | |||
55 | #endif | 55 | #endif |
56 | #include <sys/resource.h> | ||
57 | 56 | ||
@@ -134,3 +133,3 @@ public: | |||
134 | #if defined(QT_QPROCESS_DEBUG) | 133 | #if defined(QT_QPROCESS_DEBUG) |
135 | qDebug( "QProc: Constructor for pid %d and QProcess %p", pid, process ); | 134 | odebug << "QProc: Constructor for pid " << pid << " and QProcess " << process << "" << oendl; |
136 | #endif | 135 | #endif |
@@ -143,3 +142,3 @@ public: | |||
143 | #if defined(QT_QPROCESS_DEBUG) | 142 | #if defined(QT_QPROCESS_DEBUG) |
144 | qDebug( "QProc: Destructor for pid %d and QProcess %p", pid, process ); | 143 | odebug << "QProc: Destructor for pid " << pid << " and QProcess " << process << "" << oendl; |
145 | #endif | 144 | #endif |
@@ -215,3 +214,3 @@ QProcessManager::QProcessManager() | |||
215 | #if defined(QT_QPROCESS_DEBUG) | 214 | #if defined(QT_QPROCESS_DEBUG) |
216 | qDebug( "QProcessManager: install socket notifier (%d)", sigchldFd[1] ); | 215 | odebug << "QProcessManager: install socket notifier (" << sigchldFd[1] << ")" << oendl; |
217 | #endif | 216 | #endif |
@@ -228,3 +227,3 @@ QProcessManager::QProcessManager() | |||
228 | #if defined(QT_QPROCESS_DEBUG) | 227 | #if defined(QT_QPROCESS_DEBUG) |
229 | qDebug( "QProcessManager: install a SIGCHLD handler" ); | 228 | odebug << "QProcessManager: install a SIGCHLD handler" << oendl; |
230 | #endif | 229 | #endif |
@@ -238,6 +237,6 @@ QProcessManager::QProcessManager() | |||
238 | if ( sigaction( SIGCHLD, &act, &oldactChld ) != 0 ) | 237 | if ( sigaction( SIGCHLD, &act, &oldactChld ) != 0 ) |
239 | qWarning( "Error installing SIGCHLD handler" ); | 238 | owarn << "Error installing SIGCHLD handler" << oendl; |
240 | 239 | ||
241 | #if defined(QT_QPROCESS_DEBUG) | 240 | #if defined(QT_QPROCESS_DEBUG) |
242 | qDebug( "QProcessManager: install a SIGPIPE handler (SIG_IGN)" ); | 241 | odebug << "QProcessManager: install a SIGPIPE handler (SIG_IGN)" << oendl; |
243 | #endif | 242 | #endif |
@@ -254,3 +253,3 @@ QProcessManager::QProcessManager() | |||
254 | if ( sigaction( SIGPIPE, &act, &oldactPipe ) != 0 ) | 253 | if ( sigaction( SIGPIPE, &act, &oldactPipe ) != 0 ) |
255 | qWarning( "Error installing SIGPIPE handler" ); | 254 | owarn << "Error installing SIGPIPE handler" << oendl; |
256 | } | 255 | } |
@@ -268,12 +267,12 @@ QProcessManager::~QProcessManager() | |||
268 | #if defined(QT_QPROCESS_DEBUG) | 267 | #if defined(QT_QPROCESS_DEBUG) |
269 | qDebug( "QProcessManager: restore old sigchild handler" ); | 268 | odebug << "QProcessManager: restore old sigchild handler" << oendl; |
270 | #endif | 269 | #endif |
271 | if ( sigaction( SIGCHLD, &oldactChld, 0 ) != 0 ) | 270 | if ( sigaction( SIGCHLD, &oldactChld, 0 ) != 0 ) |
272 | qWarning( "Error restoring SIGCHLD handler" ); | 271 | owarn << "Error restoring SIGCHLD handler" << oendl; |
273 | 272 | ||
274 | #if defined(QT_QPROCESS_DEBUG) | 273 | #if defined(QT_QPROCESS_DEBUG) |
275 | qDebug( "QProcessManager: restore old sigpipe handler" ); | 274 | odebug << "QProcessManager: restore old sigpipe handler" << oendl; |
276 | #endif | 275 | #endif |
277 | if ( sigaction( SIGPIPE, &oldactPipe, 0 ) != 0 ) | 276 | if ( sigaction( SIGPIPE, &oldactPipe, 0 ) != 0 ) |
278 | qWarning( "Error restoring SIGPIPE handler" ); | 277 | owarn << "Error restoring SIGPIPE handler" << oendl; |
279 | } | 278 | } |
@@ -284,3 +283,3 @@ void QProcessManager::append( QProc *p ) | |||
284 | #if defined(QT_QPROCESS_DEBUG) | 283 | #if defined(QT_QPROCESS_DEBUG) |
285 | qDebug( "QProcessManager: append process (procList.count(): %d)", procList->count() ); | 284 | odebug << "QProcessManager: append process (procList.count(): " << procList->count() << ")" << oendl; |
286 | #endif | 285 | #endif |
@@ -292,3 +291,3 @@ void QProcessManager::remove( QProc *p ) | |||
292 | #if defined(QT_QPROCESS_DEBUG) | 291 | #if defined(QT_QPROCESS_DEBUG) |
293 | qDebug( "QProcessManager: remove process (procList.count(): %d)", procList->count() ); | 292 | odebug << "QProcessManager: remove process (procList.count(): " << procList->count() << ")" << oendl; |
294 | #endif | 293 | #endif |
@@ -318,3 +317,3 @@ void QProcessManager::sigchldHnd( int fd ) | |||
318 | #if defined(QT_QPROCESS_DEBUG) | 317 | #if defined(QT_QPROCESS_DEBUG) |
319 | qDebug( "QProcessManager::sigchldHnd()" ); | 318 | odebug << "QProcessManager::sigchldHnd()" << oendl; |
320 | #endif | 319 | #endif |
@@ -331,3 +330,3 @@ void QProcessManager::sigchldHnd( int fd ) | |||
331 | #if defined(QT_QPROCESS_DEBUG) | 330 | #if defined(QT_QPROCESS_DEBUG) |
332 | qDebug( "QProcessManager::sigchldHnd() (PID: %d): process exited (QProcess available)", proc->pid ); | 331 | odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): process exited (QProcess available)" << oendl; |
333 | #endif | 332 | #endif |
@@ -337,3 +336,3 @@ void QProcessManager::sigchldHnd( int fd ) | |||
337 | #if defined(QT_QPROCESS_DEBUG) | 336 | #if defined(QT_QPROCESS_DEBUG) |
338 | qDebug( "QProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stdout", proc->pid, nbytes ); | 337 | odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): reading " << nbytes << " bytes of pending data on stdout" << oendl; |
339 | #endif | 338 | #endif |
@@ -344,3 +343,3 @@ void QProcessManager::sigchldHnd( int fd ) | |||
344 | #if defined(QT_QPROCESS_DEBUG) | 343 | #if defined(QT_QPROCESS_DEBUG) |
345 | qDebug( "QProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stderr", proc->pid, nbytes ); | 344 | odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): reading " << nbytes << " bytes of pending data on stderr" << oendl; |
346 | #endif | 345 | #endif |
@@ -358,3 +357,3 @@ void QProcessManager::sigchldHnd( int fd ) | |||
358 | #if defined(QT_QPROCESS_DEBUG) | 357 | #if defined(QT_QPROCESS_DEBUG) |
359 | qDebug( "QProcessManager::sigchldHnd() (PID: %d): process exited (QProcess not available)", proc->pid ); | 358 | odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): process exited (QProcess not available)" << oendl; |
360 | #endif | 359 | #endif |
@@ -388,3 +387,3 @@ QProcessPrivate::QProcessPrivate() | |||
388 | #if defined(QT_QPROCESS_DEBUG) | 387 | #if defined(QT_QPROCESS_DEBUG) |
389 | qDebug( "QProcessPrivate: Constructor" ); | 388 | odebug << "QProcessPrivate: Constructor" << oendl; |
390 | #endif | 389 | #endif |
@@ -405,3 +404,3 @@ QProcessPrivate::~QProcessPrivate() | |||
405 | #if defined(QT_QPROCESS_DEBUG) | 404 | #if defined(QT_QPROCESS_DEBUG) |
406 | qDebug( "QProcessPrivate: Destructor" ); | 405 | odebug << "QProcessPrivate: Destructor" << oendl; |
407 | #endif | 406 | #endif |
@@ -601,3 +600,3 @@ bool QProcess::start( QStringList *env ) | |||
601 | #if defined(QT_QPROCESS_DEBUG) | 600 | #if defined(QT_QPROCESS_DEBUG) |
602 | qDebug( "QProcess::start()" ); | 601 | odebug << "QProcess::start()" << oendl; |
603 | #endif | 602 | #endif |
@@ -637,3 +636,3 @@ bool QProcess::start( QStringList *env ) | |||
637 | #if defined(QT_QPROCESS_DEBUG) | 636 | #if defined(QT_QPROCESS_DEBUG) |
638 | qDebug( "QProcess::start(): arg %d = %s", i, arglist[i] ); | 637 | odebug << "QProcess::start(): arg " << i << " = " << arglist[i] << "" << oendl; |
639 | #endif | 638 | #endif |
@@ -801,3 +800,3 @@ error: | |||
801 | #if defined(QT_QPROCESS_DEBUG) | 800 | #if defined(QT_QPROCESS_DEBUG) |
802 | qDebug( "QProcess::start(): error starting process" ); | 801 | odebug << "QProcess::start(): error starting process" << oendl; |
803 | #endif | 802 | #endif |
@@ -880,3 +879,3 @@ bool QProcess::isRunning() const | |||
880 | #if defined(QT_QPROCESS_DEBUG) | 879 | #if defined(QT_QPROCESS_DEBUG) |
881 | qDebug( "QProcess::isRunning(): FALSE (already computed)" ); | 880 | odebug << "QProcess::isRunning(): FALSE (already computed)" << oendl; |
882 | #endif | 881 | #endif |
@@ -897,3 +896,3 @@ bool QProcess::isRunning() const | |||
897 | #if defined(QT_QPROCESS_DEBUG) | 896 | #if defined(QT_QPROCESS_DEBUG) |
898 | qDebug( "QProcess::isRunning() (PID: %d): FALSE", d->proc->pid ); | 897 | odebug << "QProcess::isRunning() (PID: " << d->proc->pid << "): FALSE" << oendl; |
899 | #endif | 898 | #endif |
@@ -902,3 +901,3 @@ bool QProcess::isRunning() const | |||
902 | #if defined(QT_QPROCESS_DEBUG) | 901 | #if defined(QT_QPROCESS_DEBUG) |
903 | qDebug( "QProcess::isRunning() (PID: %d): TRUE", d->proc->pid ); | 902 | odebug << "QProcess::isRunning() (PID: " << d->proc->pid << "): TRUE" << oendl; |
904 | #endif | 903 | #endif |
@@ -922,3 +921,3 @@ void QProcess::writeToStdin( const QByteArray& buf ) | |||
922 | #if defined(QT_QPROCESS_DEBUG) | 921 | #if defined(QT_QPROCESS_DEBUG) |
923 | // qDebug( "QProcess::writeToStdin(): write to stdin (%d)", d->socketStdin ); | 922 | // odebug << "QProcess::writeToStdin(): write to stdin (" << d->socketStdin << ")" << oendl; |
924 | #endif | 923 | #endif |
@@ -949,6 +948,6 @@ void QProcess::closeStdin() | |||
949 | if ( ::close( d->proc->socketStdin ) != 0 ) { | 948 | if ( ::close( d->proc->socketStdin ) != 0 ) { |
950 | qWarning( "Could not close stdin of child process" ); | 949 | owarn << "Could not close stdin of child process" << oendl; |
951 | } | 950 | } |
952 | #if defined(QT_QPROCESS_DEBUG) | 951 | #if defined(QT_QPROCESS_DEBUG) |
953 | qDebug( "QProcess::closeStdin(): stdin (%d) closed", d->proc->socketStdin ); | 952 | odebug << "QProcess::closeStdin(): stdin (" << d->proc->socketStdin << ") closed" << oendl; |
954 | #endif | 953 | #endif |
@@ -972,3 +971,3 @@ void QProcess::socketRead( int fd ) | |||
972 | #if defined(QT_QPROCESS_DEBUG) | 971 | #if defined(QT_QPROCESS_DEBUG) |
973 | qDebug( "QProcess::socketRead(): %d", fd ); | 972 | odebug << "QProcess::socketRead(): " << fd << "" << oendl; |
974 | #endif | 973 | #endif |
@@ -1001,3 +1000,3 @@ void QProcess::socketRead( int fd ) | |||
1001 | #if defined(QT_QPROCESS_DEBUG) | 1000 | #if defined(QT_QPROCESS_DEBUG) |
1002 | qDebug( "QProcess::socketRead(): stdout (%d) closed", fd ); | 1001 | odebug << "QProcess::socketRead(): stdout (" << fd << ") closed" << oendl; |
1003 | #endif | 1002 | #endif |
@@ -1011,3 +1010,3 @@ void QProcess::socketRead( int fd ) | |||
1011 | #if defined(QT_QPROCESS_DEBUG) | 1010 | #if defined(QT_QPROCESS_DEBUG) |
1012 | qDebug( "QProcess::socketRead(): stderr (%d) closed", fd ); | 1011 | odebug << "QProcess::socketRead(): stderr (" << fd << ") closed" << oendl; |
1013 | #endif | 1012 | #endif |
@@ -1063,3 +1062,3 @@ void QProcess::socketWrite( int fd ) | |||
1063 | #if defined(QT_QPROCESS_DEBUG) | 1062 | #if defined(QT_QPROCESS_DEBUG) |
1064 | qDebug( "QProcess::socketWrite(): write to stdin (%d)", fd ); | 1063 | odebug << "QProcess::socketWrite(): write to stdin (" << fd << ")" << oendl; |
1065 | #endif | 1064 | #endif |