summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-21 15:57:07 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-21 15:57:07 +0000
commit4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1 (patch)
tree5a723851b47131c9eb226247d12bc3a53a017211
parent82f2bb99ae8440439491af7c20c13bd89d53e713 (diff)
downloadrockbox-4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1.tar.gz
rockbox-4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1.zip
Buffering should truncate if read() returns 0 since it's not a valid return there as there should be data left to read. The loop wouldn't break until there was a message in the queue. I just experienced the case with crosslinked files and read stopped making progress, returning 0 each time it was called.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29626 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/buffering.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index f70400a1ee..578f0f261a 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -691,7 +691,7 @@ static bool buffer_handle(int handle_id, size_t to_buffer)
/* rc is the actual amount read */
int rc = read(h->fd, &buffer[h->widx], copy_n);
- if (rc < 0) {
+ if (rc <= 0) {
/* Some kind of filesystem error, maybe recoverable if not codec */
if (h->type == TYPE_CODEC) {
logf("Partial codec");