From kde-commits Sun Jan 02 21:58:55 2011 From: Stephan Kulow Date: Sun, 02 Jan 2011 21:58:55 +0000 To: kde-commits Subject: [Phonon/4.1] e58f1b7: handle errors of write (I know it's only a fake Message-Id: <20110102215855.8F8D5A6166 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129400751014519 commit e58f1b717a14a688e2a11689e7bc630b9c97d9d7 branch 4.1 Author: Stephan Kulow Date: Fri Apr 21 10:39:27 2006 +0000 handle errors of write (I know it's only a fake device, but that shouldn't hinder us to write correct code :) diff --git a/tests/fakebackend/audiooutput.cpp b/tests/fakebackend/audiooutput.cpp index 611696a..7a59a69 100644 --- a/tests/fakebackend/audiooutput.cpp +++ b/tests/fakebackend/audiooutput.cpp @@ -105,6 +105,11 @@ void AudioOutput::processBuffer( const QVector& buffer ) while( size > 0 ) { written = m_dsp.write( towrite, size ); + if (written < 0) { + if (errno == EINTR) + continue; + break; + } size = size - written; if( size > 0 ) {