summaryrefslogtreecommitdiffstats
path: root/src/kernel/qprocess_unix.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-02-28 22:31:39 -0600
committerTimothy Pearson <[email protected]>2012-02-28 22:31:39 -0600
commit41bb408dde90e755b07cd2ab8a9bdec7548c84b0 (patch)
tree6d4d5407c000add30aa78630e009c0e5d633e440 /src/kernel/qprocess_unix.cpp
parent1740cd279522c060e738bbbffacab83355d2b794 (diff)
downloadtqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.tar.gz
tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.zip
Automated conversion from qt3
Diffstat (limited to 'src/kernel/qprocess_unix.cpp')
-rw-r--r--src/kernel/qprocess_unix.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/kernel/qprocess_unix.cpp b/src/kernel/qprocess_unix.cpp
index 41260d53e..ff68a8860 100644
--- a/src/kernel/qprocess_unix.cpp
+++ b/src/kernel/qprocess_unix.cpp
@@ -134,7 +134,7 @@ public:
TQProc( pid_t p, TQProcess *proc=0 ) : pid(p), process(proc)
{
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProc: Constructor for pid %d and TQProcess %p", pid, process );
+ tqDebug( "TQProc: Constructor for pid %d and TQProcess %p", pid, process );
#endif
socketStdin = 0;
socketStdout = 0;
@@ -143,7 +143,7 @@ public:
~TQProc()
{
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProc: Destructor for pid %d and TQProcess %p", pid, process );
+ tqDebug( "TQProc: Destructor for pid %d and TQProcess %p", pid, process );
#endif
if ( process ) {
if ( process->d->notifierStdin )
@@ -273,7 +273,7 @@ TQProcessManager::TQProcessManager() : sn(0)
sigchldFd[1] = 0;
} else {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: install socket notifier (%d)", sigchldFd[1] );
+ tqDebug( "TQProcessManager: install socket notifier (%d)", sigchldFd[1] );
#endif
sn = new TQSocketNotifier( sigchldFd[1],
TQSocketNotifier::Read, this );
@@ -286,7 +286,7 @@ TQProcessManager::TQProcessManager() : sn(0)
struct sigaction act;
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: install a SIGCHLD handler" );
+ tqDebug( "TQProcessManager: install a SIGCHLD handler" );
#endif
act.sa_handler = qt_C_sigchldHnd;
sigemptyset( &(act.sa_mask) );
@@ -296,17 +296,17 @@ TQProcessManager::TQProcessManager() : sn(0)
act.sa_flags |= SA_RESTART;
#endif
if ( sigaction( SIGCHLD, &act, &oldactChld ) != 0 )
- qWarning( "Error installing SIGCHLD handler" );
+ tqWarning( "Error installing SIGCHLD handler" );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: install a SIGPIPE handler (SIG_IGN)" );
+ tqDebug( "TQProcessManager: install a SIGPIPE handler (SIG_IGN)" );
#endif
act.sa_handler = QT_SIGNAL_IGNORE;
sigemptyset( &(act.sa_mask) );
sigaddset( &(act.sa_mask), SIGPIPE );
act.sa_flags = 0;
if ( sigaction( SIGPIPE, &act, &oldactPipe ) != 0 )
- qWarning( "Error installing SIGPIPE handler" );
+ tqWarning( "Error installing SIGPIPE handler" );
}
TQProcessManager::~TQProcessManager()
@@ -320,23 +320,23 @@ TQProcessManager::~TQProcessManager()
// restore SIGCHLD handler
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: restore old sigchild handler" );
+ tqDebug( "TQProcessManager: restore old sigchild handler" );
#endif
if ( sigaction( SIGCHLD, &oldactChld, 0 ) != 0 )
- qWarning( "Error restoring SIGCHLD handler" );
+ tqWarning( "Error restoring SIGCHLD handler" );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: restore old sigpipe handler" );
+ tqDebug( "TQProcessManager: restore old sigpipe handler" );
#endif
if ( sigaction( SIGPIPE, &oldactPipe, 0 ) != 0 )
- qWarning( "Error restoring SIGPIPE handler" );
+ tqWarning( "Error restoring SIGPIPE handler" );
}
void TQProcessManager::append( TQProc *p )
{
procList->append( p );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: append process (procList.count(): %d)", procList->count() );
+ tqDebug( "TQProcessManager: append process (procList.count(): %d)", procList->count() );
#endif
}
@@ -344,7 +344,7 @@ void TQProcessManager::remove( TQProc *p )
{
procList->remove( p );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager: remove process (procList.count(): %d)", procList->count() );
+ tqDebug( "TQProcessManager: remove process (procList.count(): %d)", procList->count() );
#endif
cleanup();
}
@@ -359,7 +359,7 @@ void TQProcessManager::cleanup()
void TQProcessManager::removeMe()
{
if ( procList->count() == 0 ) {
- qRemovePostRoutine(qprocess_cleanup);
+ tqRemovePostRoutine(qprocess_cleanup);
TQProcessPrivate::procManager = 0;
delete this;
}
@@ -381,7 +381,7 @@ void TQProcessManager::sigchldHnd( int fd )
char tmp;
::read( fd, &tmp, sizeof(tmp) );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager::sigchldHnd()" );
+ tqDebug( "TQProcessManager::sigchldHnd()" );
#endif
TQProc *proc;
TQProcess *process;
@@ -393,7 +393,7 @@ void TQProcessManager::sigchldHnd( int fd )
if ( process != 0 ) {
if ( !process->isRunning() ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager::sigchldHnd() (PID: %d): process exited (TQProcess available)", proc->pid );
+ tqDebug( "TQProcessManager::sigchldHnd() (PID: %d): process exited (TQProcess available)", proc->pid );
#endif
/*
Apparently, there is not consistency among different
@@ -415,14 +415,14 @@ void TQProcessManager::sigchldHnd( int fd )
// read pending data
if ( proc->socketStdout && ::ioctl(proc->socketStdout, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stdout", proc->pid, nbytes );
+ tqDebug( "TQProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stdout", proc->pid, nbytes );
#endif
process->socketRead( proc->socketStdout );
}
nbytes = 0;
if ( proc->socketStderr && ::ioctl(proc->socketStderr, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stderr", proc->pid, nbytes );
+ tqDebug( "TQProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stderr", proc->pid, nbytes );
#endif
process->socketRead( proc->socketStderr );
}
@@ -450,7 +450,7 @@ void TQProcessManager::sigchldHnd( int fd )
int status;
if ( ::waitpid( proc->pid, &status, WNOHANG ) == proc->pid ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessManager::sigchldHnd() (PID: %d): process exited (TQProcess not available)", proc->pid );
+ tqDebug( "TQProcessManager::sigchldHnd() (PID: %d): process exited (TQProcess not available)", proc->pid );
#endif
removeProc = TRUE;
}
@@ -480,7 +480,7 @@ TQProcessManager *TQProcessPrivate::procManager = 0;
TQProcessPrivate::TQProcessPrivate()
{
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessPrivate: Constructor" );
+ tqDebug( "TQProcessPrivate: Constructor" );
#endif
stdinBufRead = 0;
@@ -497,7 +497,7 @@ TQProcessPrivate::TQProcessPrivate()
TQProcessPrivate::~TQProcessPrivate()
{
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcessPrivate: Destructor" );
+ tqDebug( "TQProcessPrivate: Destructor" );
#endif
if ( proc != 0 ) {
@@ -543,7 +543,7 @@ void TQProcessPrivate::newProc( pid_t pid, TQProcess *process )
proc = new TQProc( pid, process );
if ( procManager == 0 ) {
procManager = new TQProcessManager;
- qAddPostRoutine(qprocess_cleanup);
+ tqAddPostRoutine(qprocess_cleanup);
}
// the TQProcessManager takes care of deleting the TQProc instances
procManager->append( proc );
@@ -700,7 +700,7 @@ TQProcess::~TQProcess()
bool TQProcess::start( TQStringList *env )
{
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::start()" );
+ tqDebug( "TQProcess::start()" );
#endif
reset();
@@ -760,7 +760,7 @@ bool TQProcess::start( TQStringList *env )
arglistQ[i] = (*it).local8Bit();
arglist[i] = arglistQ[i];
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::start(): arg %d = %s", i, arglist[i] );
+ tqDebug( "TQProcess::start(): arg %d = %s", i, arglist[i] );
#endif
i++;
}
@@ -788,7 +788,7 @@ bool TQProcess::start( TQStringList *env )
// in case the process exits tquickly.
if ( d->procManager == 0 ) {
d->procManager = new TQProcessManager;
- qAddPostRoutine(qprocess_cleanup);
+ tqAddPostRoutine(qprocess_cleanup);
}
// fork and exec
@@ -969,7 +969,7 @@ bool TQProcess::start( TQStringList *env )
error:
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::start(): error starting process" );
+ tqDebug( "TQProcess::start(): error starting process" );
#endif
if ( d->procManager )
d->procManager->cleanup();
@@ -1050,7 +1050,7 @@ bool TQProcess::isRunning() const
{
if ( d->exitValuesCalculated ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::isRunning(): FALSE (already computed)" );
+ tqDebug( "TQProcess::isRunning(): FALSE (already computed)" );
#endif
return FALSE;
}
@@ -1080,12 +1080,12 @@ bool TQProcess::isRunning() const
}
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::isRunning() (PID: %d): FALSE", d->proc->pid );
+ tqDebug( "TQProcess::isRunning() (PID: %d): FALSE", d->proc->pid );
#endif
return FALSE;
}
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::isRunning() (PID: %d): TRUE", d->proc->pid );
+ tqDebug( "TQProcess::isRunning() (PID: %d): TRUE", d->proc->pid );
#endif
return TRUE;
}
@@ -1142,7 +1142,7 @@ bool TQProcess::canReadLineStderr() const
void TQProcess::writeToStdin( const TQByteArray& buf )
{
#if defined(QT_QPROCESS_DEBUG)
-// qDebug( "TQProcess::writeToStdin(): write to stdin (%d)", d->socketStdin );
+// tqDebug( "TQProcess::writeToStdin(): write to stdin (%d)", d->socketStdin );
#endif
d->stdinBuf.enqueue( new TQByteArray(buf) );
if ( d->notifierStdin != 0 )
@@ -1169,10 +1169,10 @@ void TQProcess::closeStdin()
delete d->notifierStdin;
d->notifierStdin = 0;
if ( ::close( d->proc->socketStdin ) != 0 ) {
- qWarning( "Could not close stdin of child process" );
+ tqWarning( "Could not close stdin of child process" );
}
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::closeStdin(): stdin (%d) closed", d->proc->socketStdin );
+ tqDebug( "TQProcess::closeStdin(): stdin (%d) closed", d->proc->socketStdin );
#endif
d->proc->socketStdin = 0;
}
@@ -1193,7 +1193,7 @@ void TQProcess::socketRead( int fd )
}
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketRead(): %d", fd );
+ tqDebug( "TQProcess::socketRead(): %d", fd );
#endif
if ( fd == 0 )
return;
@@ -1229,7 +1229,7 @@ void TQProcess::socketRead( int fd )
if ( n == 0 || n == -1 ) {
if ( fd == d->proc->socketStdout ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketRead(): stdout (%d) closed", fd );
+ tqDebug( "TQProcess::socketRead(): stdout (%d) closed", fd );
#endif
d->notifierStdout->setEnabled( FALSE );
delete d->notifierStdout;
@@ -1239,7 +1239,7 @@ void TQProcess::socketRead( int fd )
return;
} else if ( fd == d->proc->socketStderr ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketRead(): stderr (%d) closed", fd );
+ tqDebug( "TQProcess::socketRead(): stderr (%d) closed", fd );
#endif
d->notifierStderr->setEnabled( FALSE );
delete d->notifierStderr;
@@ -1279,13 +1279,13 @@ void TQProcess::socketRead( int fd )
d->socketReadCalled = TRUE;
if ( fd == d->proc->socketStdout ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketRead(): %d bytes read from stdout (%d)",
+ tqDebug( "TQProcess::socketRead(): %d bytes read from stdout (%d)",
buffer->size()-oldSize, fd );
#endif
emit readyReadStdout();
} else if ( fd == d->proc->socketStderr ) {
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketRead(): %d bytes read from stderr (%d)",
+ tqDebug( "TQProcess::socketRead(): %d bytes read from stderr (%d)",
buffer->size()-oldSize, fd );
#endif
emit readyReadStderr();
@@ -1309,7 +1309,7 @@ void TQProcess::socketWrite( int fd )
d->stdinBuf.head()->data() + d->stdinBufRead,
d->stdinBuf.head()->size() - d->stdinBufRead );
#if defined(QT_QPROCESS_DEBUG)
- qDebug( "TQProcess::socketWrite(): wrote %d bytes to stdin (%d)", ret, fd );
+ tqDebug( "TQProcess::socketWrite(): wrote %d bytes to stdin (%d)", ret, fd );
#endif
if ( ret == -1 )
return;