diff options
Diffstat (limited to 'src/kernel/tqprocess_unix.cpp')
| -rw-r--r-- | src/kernel/tqprocess_unix.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/kernel/tqprocess_unix.cpp b/src/kernel/tqprocess_unix.cpp index 606d1fd28..e481c92c3 100644 --- a/src/kernel/tqprocess_unix.cpp +++ b/src/kernel/tqprocess_unix.cpp @@ -147,11 +147,11 @@ public: #endif if ( process ) { if ( process->d->notifierStdin ) - process->d->notifierStdin->setEnabled( FALSE ); + process->d->notifierStdin->setEnabled( false ); if ( process->d->notifierStdout ) - process->d->notifierStdout->setEnabled( FALSE ); + process->d->notifierStdout->setEnabled( false ); if ( process->d->notifierStderr ) - process->d->notifierStderr->setEnabled( FALSE ); + process->d->notifierStderr->setEnabled( false ); process->d->proc = 0; } if( socketStdin ) @@ -225,11 +225,11 @@ int qnx6SocketPairReplacement (int socketFD[2]) { int socketOptions = 1; setsockopt(tmpSocket, SOL_SOCKET, SO_REUSEADDR, &socketOptions, sizeof(int)); - bool found = FALSE; + bool found = false; for (int socketIP = 2000; (socketIP < 2500) && !(found); socketIP++) { ipAddr.sin_port = htons(socketIP); if (bind(tmpSocket, (struct sockaddr *)&ipAddr, sizeof(ipAddr))) - found = TRUE; + found = true; } if (listen(tmpSocket, 5)) { BAILOUT }; @@ -259,7 +259,7 @@ int qnx6SocketPairReplacement (int socketFD[2]) { TQProcessManager::TQProcessManager() : sn(0) { procList = new TQPtrList<TQProc>; - procList->setAutoDelete( TRUE ); + procList->setAutoDelete( true ); // The SIGCHLD handler writes to a socket to tell the manager that // something happened. This is done to get the processing in sync with the @@ -279,7 +279,7 @@ TQProcessManager::TQProcessManager() : sn(0) TQSocketNotifier::Read, this ); connect( sn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(sigchldHnd(int)) ); - sn->setEnabled( TRUE ); + sn->setEnabled( true ); } // install a SIGCHLD handler and ignore SIGPIPE @@ -375,7 +375,7 @@ void TQProcessManager::sigchldHnd( int fd ) if ( sn ) { if ( !sn->isEnabled() ) return; - sn->setEnabled( FALSE ); + sn->setEnabled( false ); } char tmp; @@ -390,7 +390,7 @@ void TQProcessManager::sigchldHnd( int fd ) bool removeProc; proc = procList->first(); while ( proc != 0 ) { - removeProc = FALSE; + removeProc = false; process = proc->process; if ( process != 0 ) { if ( !process->isRunning() ) { @@ -434,19 +434,19 @@ void TQProcessManager::sigchldHnd( int fd ) ::close( proc->socketStdout ); proc->socketStdout = 0; if (process->d->notifierStdout) - process->d->notifierStdout->setEnabled(FALSE); + process->d->notifierStdout->setEnabled(false); } if ( proc->socketStderr ) { ::close( proc->socketStderr ); proc->socketStderr = 0; if (process->d->notifierStderr) - process->d->notifierStderr->setEnabled(FALSE); + process->d->notifierStderr->setEnabled(false); } if ( process->notifyOnExit ) emit process->processExited(); - removeProc = TRUE; + removeProc = true; } } else { int status; @@ -454,7 +454,7 @@ void TQProcessManager::sigchldHnd( int fd ) #if defined(QT_QPROCESS_DEBUG) tqDebug( "TQProcessManager::sigchldHnd() (PID: %d): process exited (TQProcess not available)", proc->pid ); #endif - removeProc = TRUE; + removeProc = true; } } if ( removeProc ) { @@ -466,7 +466,7 @@ void TQProcessManager::sigchldHnd( int fd ) } } if ( sn ) - sn->setEnabled( TRUE ); + sn->setEnabled( true ); } #include "tqprocess_unix.moc" @@ -490,8 +490,8 @@ TQProcessPrivate::TQProcessPrivate() notifierStdout = 0; notifierStderr = 0; - exitValuesCalculated = FALSE; - socketReadCalled = FALSE; + exitValuesCalculated = false; + socketReadCalled = false; proc = 0; } @@ -582,7 +582,7 @@ void TQProcess::init() { d = new TQProcessPrivate(); exitStat = 0; - exitNormal = FALSE; + exitNormal = false; } /* @@ -594,7 +594,7 @@ void TQProcess::reset() delete d; d = new TQProcessPrivate(); exitStat = 0; - exitNormal = FALSE; + exitNormal = false; d->bufStdout.clear(); d->bufStderr.clear(); } @@ -684,8 +684,8 @@ TQProcess::~TQProcess() this variable is inherited from the starting process; under Windows the same applies for the environment variable \c PATH. - Returns TRUE if the process could be started; otherwise returns - FALSE. + Returns true if the process could be started; otherwise returns + false. You can write data to the process's standard input with writeToStdin(). You can close standard input with closeStdin() and @@ -718,7 +718,7 @@ bool TQProcess::start( TQStringList *env ) #else if ( (comms & Stdin) && qnx6SocketPairReplacement(sStdin) == -1 ) { #endif - return FALSE; + return false; } #ifndef Q_OS_QNX6 if ( (comms & Stderr) && ::socketpair( AF_UNIX, SOCK_STREAM, 0, sStderr ) == -1 ) { @@ -729,7 +729,7 @@ bool TQProcess::start( TQStringList *env ) ::close( sStdin[0] ); ::close( sStdin[1] ); } - return FALSE; + return false; } #ifndef Q_OS_QNX6 if ( (comms & Stdout) && ::socketpair( AF_UNIX, SOCK_STREAM, 0, sStdout ) == -1 ) { @@ -744,7 +744,7 @@ bool TQProcess::start( TQStringList *env ) ::close( sStderr[0] ); ::close( sStderr[1] ); } - return FALSE; + return false; } // the following pipe is only used to determine if the process could be @@ -948,7 +948,7 @@ bool TQProcess::start( TQStringList *env ) this, TQ_SLOT(socketWrite(int)) ); // setup notifiers for the sockets if ( !d->stdinBuf.isEmpty() ) { - d->notifierStdin->setEnabled( TRUE ); + d->notifierStdin->setEnabled( true ); } } if ( comms & Stdout ) { @@ -958,7 +958,7 @@ bool TQProcess::start( TQStringList *env ) connect( d->notifierStdout, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketRead(int)) ); if ( ioRedirection ) - d->notifierStdout->setEnabled( TRUE ); + d->notifierStdout->setEnabled( true ); } if ( comms & Stderr ) { ::close( sStderr[1] ); @@ -967,13 +967,13 @@ bool TQProcess::start( TQStringList *env ) connect( d->notifierStderr, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketRead(int)) ); if ( ioRedirection ) - d->notifierStderr->setEnabled( TRUE ); + d->notifierStderr->setEnabled( true ); } // cleanup and return delete[] arglistQ; delete[] arglist; - return TRUE; + return true; error: #if defined(QT_QPROCESS_DEBUG) @@ -997,7 +997,7 @@ error: ::close( fd[1] ); delete[] arglistQ; delete[] arglist; - return FALSE; + return false; } @@ -1050,7 +1050,7 @@ void TQProcess::kill() const } /*! - Returns TRUE if the process is running; otherwise returns FALSE. + Returns true if the process is running; otherwise returns false. \sa normalExit() exitStatus() processExited() */ @@ -1058,12 +1058,12 @@ bool TQProcess::isRunning() const { if ( d->exitValuesCalculated ) { #if defined(QT_QPROCESS_DEBUG) - tqDebug( "TQProcess::isRunning(): FALSE (already computed)" ); + tqDebug( "TQProcess::isRunning(): false (already computed)" ); #endif - return FALSE; + return false; } if ( d->proc == 0 ) - return FALSE; + return false; int status; if ( ::waitpid( d->proc->pid, &status, WNOHANG ) == d->proc->pid ) { // compute the exit values @@ -1072,7 +1072,7 @@ bool TQProcess::isRunning() const if ( exitNormal ) { that->exitStat = (char)WEXITSTATUS( status ); } - d->exitValuesCalculated = TRUE; + d->exitValuesCalculated = true; // On heavy processing, the socket notifier for the sigchild might not // have found time to fire yet. @@ -1088,19 +1088,19 @@ bool TQProcess::isRunning() const } #if defined(QT_QPROCESS_DEBUG) - tqDebug( "TQProcess::isRunning() (PID: %d): FALSE", d->proc->pid ); + tqDebug( "TQProcess::isRunning() (PID: %d): false", d->proc->pid ); #endif - return FALSE; + return false; } #if defined(QT_QPROCESS_DEBUG) - tqDebug( "TQProcess::isRunning() (PID: %d): TRUE", d->proc->pid ); + tqDebug( "TQProcess::isRunning() (PID: %d): true", d->proc->pid ); #endif - return TRUE; + return true; } /*! - Returns TRUE if it's possible to read an entire line of text from - standard output at this time; otherwise returns FALSE. + Returns true if it's possible to read an entire line of text from + standard output at this time; otherwise returns false. \sa readLineStdout() canReadLineStderr() */ @@ -1114,8 +1114,8 @@ bool TQProcess::canReadLineStdout() const } /*! - Returns TRUE if it's possible to read an entire line of text from - standard error at this time; otherwise returns FALSE. + Returns true if it's possible to read an entire line of text from + standard error at this time; otherwise returns false. \sa readLineStderr() canReadLineStdout() */ @@ -1154,7 +1154,7 @@ void TQProcess::writeToStdin( const TQByteArray& buf ) #endif d->stdinBuf.enqueue( new TQByteArray(buf) ); if ( d->notifierStdin != 0 ) - d->notifierStdin->setEnabled( TRUE ); + d->notifierStdin->setEnabled( true ); } @@ -1239,7 +1239,7 @@ void TQProcess::socketRead( int fd ) #if defined(QT_QPROCESS_DEBUG) tqDebug( "TQProcess::socketRead(): stdout (%d) closed", fd ); #endif - d->notifierStdout->setEnabled( FALSE ); + d->notifierStdout->setEnabled( false ); delete d->notifierStdout; d->notifierStdout = 0; ::close( d->proc->socketStdout ); @@ -1249,7 +1249,7 @@ void TQProcess::socketRead( int fd ) #if defined(QT_QPROCESS_DEBUG) tqDebug( "TQProcess::socketRead(): stderr (%d) closed", fd ); #endif - d->notifierStderr->setEnabled( FALSE ); + d->notifierStderr->setEnabled( false ); delete d->notifierStderr; d->notifierStderr = 0; ::close( d->proc->socketStderr ); @@ -1284,7 +1284,7 @@ void TQProcess::socketRead( int fd ) } } - d->socketReadCalled = TRUE; + d->socketReadCalled = true; if ( fd == d->proc->socketStdout ) { #if defined(QT_QPROCESS_DEBUG) tqDebug( "TQProcess::socketRead(): %d bytes read from stdout (%d)", @@ -1298,7 +1298,7 @@ void TQProcess::socketRead( int fd ) #endif emit readyReadStderr(); } - d->socketReadCalled = FALSE; + d->socketReadCalled = false; } @@ -1310,7 +1310,7 @@ void TQProcess::socketWrite( int fd ) { while ( fd == d->proc->socketStdin && d->proc->socketStdin != 0 ) { if ( d->stdinBuf.isEmpty() ) { - d->notifierStdin->setEnabled( FALSE ); + d->notifierStdin->setEnabled( false ); return; } ssize_t ret = ::write( fd, @@ -1362,14 +1362,14 @@ void TQProcess::setIoRedirection( bool value ) ioRedirection = value; if ( ioRedirection ) { if ( d->notifierStdout ) - d->notifierStdout->setEnabled( TRUE ); + d->notifierStdout->setEnabled( true ); if ( d->notifierStderr ) - d->notifierStderr->setEnabled( TRUE ); + d->notifierStderr->setEnabled( true ); } else { if ( d->notifierStdout ) - d->notifierStdout->setEnabled( FALSE ); + d->notifierStdout->setEnabled( false ); if ( d->notifierStderr ) - d->notifierStderr->setEnabled( FALSE ); + d->notifierStderr->setEnabled( false ); } } |
