-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,100 +1,100 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #ifndef QT_H | 21 | #ifndef QT_H |
22 | # include <qfeatures.h> | 22 | # include <qfeatures.h> |
23 | #endif // QT_H | 23 | #endif // QT_H |
24 | 24 | ||
25 | #ifndef QT_NO_PROCESS | 25 | #ifndef QT_NO_PROCESS |
26 | 26 | ||
27 | //#include "qplatformdefs.h" | 27 | //#include "qplatformdefs.h" |
28 | #include <stdio.h> | 28 | #include <stdio.h> |
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | #include <signal.h> | 30 | #include <signal.h> |
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
33 | #include <fcntl.h> | 33 | #include <fcntl.h> |
34 | 34 | ||
35 | #include "process.h" | 35 | #include "process.h" |
36 | #include "qapplication.h" | 36 | #include "qapplication.h" |
37 | //#include "qptrqueue.h" | 37 | //#include "qptrqueue.h" |
38 | //#include "qptrlist.h" | 38 | //#include "qptrlist.h" |
39 | #include "qsocketnotifier.h" | 39 | #include "qsocketnotifier.h" |
40 | #include "qtimer.h" | 40 | #include "qtimer.h" |
41 | //#include "qcleanuphandler.h" | 41 | //#include "qcleanuphandler.h" |
42 | #include "qregexp.h" | 42 | #include "qregexp.h" |
43 | 43 | ||
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | #include <errno.h> | 45 | #include <errno.h> |
46 | 46 | ||
47 | #define QPtrList QList | 47 | #define QPtrList QList |
48 | 48 | ||
49 | //#define QT_QPROCESS_DEBUG | 49 | //#define QT_QPROCESS_DEBUG |
50 | 50 | ||
51 | 51 | ||
52 | class Proc; | 52 | class Proc; |
53 | class ProcessManager; | 53 | class ProcessManager; |
54 | class ProcessPrivate | 54 | class ProcessPrivate |
55 | { | 55 | { |
56 | public: | 56 | public: |
57 | ProcessPrivate(); | 57 | ProcessPrivate(); |
58 | ~ProcessPrivate(); | 58 | ~ProcessPrivate(); |
59 | 59 | ||
60 | void closeOpenSocketsForChild(); | 60 | void closeOpenSocketsForChild(); |
61 | void newProc( pid_t pid, Process *process ); | 61 | void newProc( pid_t pid, Process *process ); |
62 | 62 | ||
63 | QByteArray bufStdout; | 63 | QByteArray bufStdout; |
64 | QByteArray bufStderr; | 64 | QByteArray bufStderr; |
65 | 65 | ||
66 | QSocketNotifier *notifierStdin; | 66 | QSocketNotifier *notifierStdin; |
67 | QSocketNotifier *notifierStdout; | 67 | QSocketNotifier *notifierStdout; |
68 | QSocketNotifier *notifierStderr; | 68 | QSocketNotifier *notifierStderr; |
69 | 69 | ||
70 | ssize_t stdinBufRead; | 70 | ssize_t stdinBufRead; |
71 | Proc *proc; | 71 | Proc *proc; |
72 | 72 | ||
73 | bool exitValuesCalculated; | 73 | bool exitValuesCalculated; |
74 | bool socketReadCalled; | 74 | bool socketReadCalled; |
75 | 75 | ||
76 | static ProcessManager *procManager; | 76 | static ProcessManager *procManager; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | /*********************************************************************** | 80 | /*********************************************************************** |
81 | * | 81 | * |
82 | * Proc | 82 | * Proc |
83 | * | 83 | * |
84 | **********************************************************************/ | 84 | **********************************************************************/ |
85 | /* | 85 | /* |
86 | The class Process does not necessarily map exactly to the running | 86 | The class Process does not necessarily map exactly to the running |
87 | child processes: if the process is finished, the Process class may still be | 87 | child processes: if the process is finished, the Process class may still be |
88 | there; furthermore a user can use Process to start more than one process. | 88 | there; furthermore a user can use Process to start more than one process. |
89 | 89 | ||
90 | The helper-class Proc has the semantics that one instance of this class maps | 90 | The helper-class Proc has the semantics that one instance of this class maps |
91 | directly to a running child process. | 91 | directly to a running child process. |
92 | */ | 92 | */ |
93 | class Proc | 93 | class Proc |
94 | { | 94 | { |
95 | public: | 95 | public: |
96 | Proc( pid_t p, Process *proc=0 ) : pid(p), process(proc) | 96 | Proc( pid_t p, Process *proc=0 ) : pid(p), process(proc) |
97 | { | 97 | { |
98 | #if defined(QT_QPROCESS_DEBUG) | 98 | #if defined(QT_QPROCESS_DEBUG) |
99 | qDebug( "Proc: Constructor for pid %d and Process %p", pid, process ); | 99 | qDebug( "Proc: Constructor for pid %d and Process %p", pid, process ); |
100 | #endif | 100 | #endif |