diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-08-27 09:05:01 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-08-27 09:05:01 +0000 |
| commit | 948033c2cdf7124a3caed78d7ca8316daa0c77c5 (patch) | |
| tree | c615314daa7f697dc0c49d90db8b03ddc2ccb5c4 /lib/base/console.cpp | |
| parent | ff483cd208f38b22aa9aeebba228bd361a3caf22 (diff) | |
| download | enigma2-948033c2cdf7124a3caed78d7ca8316daa0c77c5.tar.gz enigma2-948033c2cdf7124a3caed78d7ca8316daa0c77c5.zip | |
fix write
Diffstat (limited to 'lib/base/console.cpp')
| -rw-r--r-- | lib/base/console.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/base/console.cpp b/lib/base/console.cpp index c923da52..0a01094b 100644 --- a/lib/base/console.cpp +++ b/lib/base/console.cpp @@ -371,18 +371,17 @@ void eConsoleAppContainer::readyWrite(int what) if (what&eSocketNotifier::Write && outbuf.size() ) { queue_data d = outbuf.front(); - outbuf.pop(); - if ( ::write( fd[1], d.data, d.len ) != d.len ) - { - /* emit */ dataSent(-1); -// eDebug("writeError"); - } + int wr = ::write( fd[1], d.data+d.dataSent, d.len-d.dataSent ); + if (wr < 0) + eDebug("eConsoleAppContainer write failed (%m)"); else + d.dataSent += wr; + if (d.dataSent == d.len) { + outbuf.pop(); + delete [] d.data; /* emit */ dataSent(0); -// eDebug("write ok"); } - delete [] d.data; } if ( !outbuf.size() ) out->stop(); |
