diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2011-09-16 17:37:54 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2011-09-16 17:37:54 +0000 |
| commit | 9945d6c97f8b97c5647cd1b61640df73be83cad7 (patch) | |
| tree | 17d8d120ca277f00f42a5b44f1b7f7e77f541ce6 /src/process.cpp | |
| parent | 6df767863656d2e3efffed562a02180b3ea11624 (diff) | |
| download | libbu++-9945d6c97f8b97c5647cd1b61640df73be83cad7.tar.gz libbu++-9945d6c97f8b97c5647cd1b61640df73be83cad7.tar.bz2 libbu++-9945d6c97f8b97c5647cd1b61640df73be83cad7.tar.xz libbu++-9945d6c97f8b97c5647cd1b61640df73be83cad7.zip | |
More helper functions for Bu::Process.
Diffstat (limited to 'src/process.cpp')
| -rw-r--r-- | src/process.cpp | 17 |
1 files changed, 15 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 ) |
