diff options
Diffstat (limited to '')
-rw-r--r-- | src/process.cpp | 17 | ||||
-rw-r--r-- | src/process.h | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/process.cpp b/src/process.cpp index e6b9f3d..55824ae 100644 --- a/src/process.cpp +++ b/src/process.cpp | |||
@@ -176,8 +176,9 @@ void Bu::Process::close() | |||
176 | { | 176 | { |
177 | if( iPid ) | 177 | if( iPid ) |
178 | { | 178 | { |
179 | ::close( iStdIn ); | 179 | if( iStdIn > -1 ) |
180 | if( iStdErr > -1 ) | 180 | ::close( iStdIn ); |
181 | if( iStdOut > -1 ) | ||
181 | ::close( iStdOut ); | 182 | ::close( iStdOut ); |
182 | if( iStdErr > -1 ) | 183 | if( iStdErr > -1 ) |
183 | ::close( iStdErr ); | 184 | ::close( iStdErr ); |
@@ -186,6 +187,18 @@ void Bu::Process::close() | |||
186 | } | 187 | } |
187 | } | 188 | } |
188 | 189 | ||
190 | void Bu::Process::closeStdIn() | ||
191 | { | ||
192 | ::close( iStdIn ); | ||
193 | iStdIn = -1; | ||
194 | } | ||
195 | |||
196 | void Bu::Process::closeStdOut() | ||
197 | { | ||
198 | ::close( iStdOut ); | ||
199 | iStdOut = -1; | ||
200 | } | ||
201 | |||
189 | Bu::size Bu::Process::read( void *pBuf, Bu::size nBytes ) | 202 | Bu::size Bu::Process::read( void *pBuf, Bu::size nBytes ) |
190 | { | 203 | { |
191 | if( bStdOutEos ) | 204 | if( bStdOutEos ) |
diff --git a/src/process.h b/src/process.h index 6295b49..d6282e0 100644 --- a/src/process.h +++ b/src/process.h | |||
@@ -63,6 +63,8 @@ namespace Bu | |||
63 | void wait(); | 63 | void wait(); |
64 | 64 | ||
65 | virtual void close(); | 65 | virtual void close(); |
66 | virtual void closeStdIn(); | ||
67 | virtual void closeStdOut(); | ||
66 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); | 68 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
67 | virtual Bu::size readErr( void *pBuf, Bu::size nBytes ); | 69 | virtual Bu::size readErr( void *pBuf, Bu::size nBytes ); |
68 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); | 70 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |