summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-11-08 16:06:24 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-11-08 16:06:24 +0000
commit551db40abb4c9c1664c291bc431c4a3f55e530c7 (patch)
tree863fdac809c50b1d16e5f9b81582c826ac289e8b /apps
parent1db42433795af7a6d3eebbb8748d4a8d33088b26 (diff)
downloadrockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.tar.gz
rockbox-551db40abb4c9c1664c291bc431c4a3f55e530c7.zip
Clean up a (nearly impossible) null check. Add a comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15536 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/buffering.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 655e5cfdaf..c59fc52b8a 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -1006,7 +1006,11 @@ static struct memory_handle *prep_bufdata(int handle_id, size_t *size,
1006 do 1006 do
1007 { 1007 {
1008 sleep(1); 1008 sleep(1);
1009 /* it is not safe for a non-buffering thread to sleep while
1010 * holding a handle */
1009 h = find_handle(handle_id); 1011 h = find_handle(handle_id);
1012 if (!h)
1013 return NULL;
1010 avail = RINGBUF_SUB(h->widx, h->ridx); 1014 avail = RINGBUF_SUB(h->widx, h->ridx);
1011 } 1015 }
1012 while (h->filerem > 0 && avail < *size); 1016 while (h->filerem > 0 && avail < *size);