[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Phonon/4.1] e58f1b7: handle errors of write (I know it's only a fake
From:       Stephan Kulow <coolo () kde ! org>
Date:       2011-01-02 21:58:55
Message-ID: 20110102215855.8F8D5A6166 () git ! kde ! org
[Download RAW message or body]

commit e58f1b717a14a688e2a11689e7bc630b9c97d9d7
branch 4.1
Author: Stephan Kulow <coolo@kde.org>
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<float>& buffer )
 	while( size > 0 )
 	{
 		written = m_dsp.write( towrite, size );
+		if (written < 0) {
+			if (errno == EINTR)
+				continue;
+			break;
+		}
 		size = size - written;
 		if( size > 0 )
 		{
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic