-rw-r--r-- | library/process_unix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/process_unix.cpp b/library/process_unix.cpp index b599edb..e0fbf8c 100644 --- a/library/process_unix.cpp +++ b/library/process_unix.cpp @@ -1,132 +1,132 @@ /********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** This file is part of Qtopia Environment. +** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QT_H # include <qfeatures.h> #endif // QT_H #ifndef QT_NO_PROCESS //#include "qplatformdefs.h" #include <stdio.h> #include <unistd.h> #include <signal.h> #include <sys/types.h> #include <sys/socket.h> #include <fcntl.h> #include "process.h" #include "qapplication.h" //#include "qptrqueue.h" //#include "qptrlist.h" #include "qsocketnotifier.h" #include "qtimer.h" //#include "qcleanuphandler.h" #include "qregexp.h" #include <stdlib.h> #include <errno.h> #define QPtrList QList //#define QT_QPROCESS_DEBUG class Proc; class ProcessManager; class ProcessPrivate { public: ProcessPrivate(); ~ProcessPrivate(); void closeOpenSocketsForChild(); void newProc( pid_t pid, Process *process ); QByteArray bufStdout; QByteArray bufStderr; QSocketNotifier *notifierStdin; QSocketNotifier *notifierStdout; QSocketNotifier *notifierStderr; ssize_t stdinBufRead; Proc *proc; bool exitValuesCalculated; bool socketReadCalled; static ProcessManager *procManager; }; /*********************************************************************** * * Proc * **********************************************************************/ /* The class Process does not necessarily map exactly to the running child processes: if the process is finished, the Process class may still be there; furthermore a user can use Process to start more than one process. The helper-class Proc has the semantics that one instance of this class maps directly to a running child process. */ class Proc { public: Proc( pid_t p, Process *proc=0 ) : pid(p), process(proc) { #if defined(QT_QPROCESS_DEBUG) qDebug( "Proc: Constructor for pid %d and Process %p", pid, process ); #endif socketStdin = 0; socketStdout = 0; socketStderr = 0; } ~Proc() { #if defined(QT_QPROCESS_DEBUG) qDebug( "Proc: Destructor for pid %d and Process %p", pid, process ); #endif if ( process != 0 ) { if ( process->d->notifierStdin ) process->d->notifierStdin->setEnabled( FALSE ); if ( process->d->notifierStdout ) process->d->notifierStdout->setEnabled( FALSE ); if ( process->d->notifierStderr ) process->d->notifierStderr->setEnabled( FALSE ); process->d->proc = 0; } if( socketStdin != 0 ) ::close( socketStdin ); // ### close these sockets even on parent exit or is it better only on // sigchld (but what do I have to do with them on exit then)? if( socketStdout != 0 ) ::close( socketStdout ); if( socketStderr != 0 ) ::close( socketStderr ); } pid_t pid; int socketStdin; int socketStdout; int socketStderr; |