aboutsummaryrefslogtreecommitdiff
path: root/src/process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.cpp')
-rw-r--r--src/process.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/process.cpp b/src/process.cpp
index bea5932..9340647 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -94,7 +94,13 @@ void Bu::Process::close()
94 94
95size_t Bu::Process::read( void *pBuf, size_t nBytes ) 95size_t Bu::Process::read( void *pBuf, size_t nBytes )
96{ 96{
97 return TEMP_FAILURE_RETRY( ::read( iStdOut, pBuf, nBytes ) ); 97 size_t nRead = TEMP_FAILURE_RETRY( ::read( iStdOut, pBuf, nBytes ) );
98 if( nRead == 0 )
99 {
100 close();
101 return 0;
102 }
103 return nRead;
98 /* 104 /*
99 size_t iTotal = 0; 105 size_t iTotal = 0;
100 for(;;) 106 for(;;)
@@ -162,12 +168,12 @@ void Bu::Process::setPosEnd( long )
162 168
163bool Bu::Process::isEos() 169bool Bu::Process::isEos()
164{ 170{
165 return false; 171 return (iPid == 0);
166} 172}
167 173
168bool Bu::Process::isOpen() 174bool Bu::Process::isOpen()
169{ 175{
170 return true; 176 return (iPid != 0);
171} 177}
172 178
173void Bu::Process::flush() 179void Bu::Process::flush()
@@ -212,3 +218,8 @@ void Bu::Process::setBlocking( bool bBlocking )
212 fcntl( iStdOut, F_SETFL, fcntl( iStdOut, F_GETFL, 0 )|O_NONBLOCK ); 218 fcntl( iStdOut, F_SETFL, fcntl( iStdOut, F_GETFL, 0 )|O_NONBLOCK );
213} 219}
214 220
221pid_t Bu::Process::getPid()
222{
223 return iPid;
224}
225