Correctly report buffer status.

This commit is contained in:
Vreixo Formoso 2008-01-25 13:28:13 +01:00
parent 39a1493bcd
commit 6bb58a2cd1

View File

@ -322,7 +322,7 @@ int iso_ring_buffer_get_status(struct burn_source *b, size_t *size,
*free_bytes = buf->cap - buf->size; *free_bytes = buf->cap - buf->size;
} }
ret = (buf->rend + 1) + (buf->wend ? 4 : 0); ret = (buf->rend ? 4 : 0) + (buf->wend + 1);
pthread_mutex_unlock(&buf->mutex); pthread_mutex_unlock(&buf->mutex);
return ret; return ret;