From cd1a95f55aba06920392b0d0dd4230ebce71c173 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 9 Feb 2012 15:23:17 +0000 Subject: [PATCH] * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::write): Set bytes_to_write to 0 in case it fits into the buffer, otherwise suffer early EOF in caller. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_dsp.cc | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2094317ad..ef7e21944 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2012-02-09 Corinna Vinschen + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::write): Set + bytes_to_write to 0 in case it fits into the buffer, otherwise suffer + early EOF in caller. + 2012-02-09 Corinna Vinschen * dll_init.h (struct dll): Re-add modname. diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index de2169eed..1cb3b465e 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -1,6 +1,6 @@ /* fhandler_dev_dsp: code to emulate OSS sound model /dev/dsp - Copyright 2001, 2002, 2003, 2004, 2008, 2011 Red Hat, Inc + Copyright 2001, 2002, 2003, 2004, 2008, 2011, 2012 Red Hat, Inc Written by Andy Younger (andy@snoogie.demon.co.uk) Extended by Gerd Spalink (Gerd.Spalink@t-online.de) @@ -478,6 +478,7 @@ fhandler_dev_dsp::Audio_out::write (const char *pSampleData, int nBytes) { // all data fits into the current block, with some space left memcpy (&pHdr_->lpData[bufferIndex_], pSampleData, bytes_to_write); bufferIndex_ += bytes_to_write; + bytes_to_write = 0; break; } else