]> git.tuebingen.mpg.de Git - paraslash.git/commit
writers: Unify ->pre_select().
authorAndre Noll <maan@systemlinux.org>
Fri, 5 Nov 2010 07:45:20 +0000 (08:45 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 23 Nov 2010 16:43:08 +0000 (17:43 +0100)
commit2ef39ae4d1e6b0d95991d2b980621fb152211444
treef1735525795b9faaeb21b762761e0636b90989f4
parentd56a8447f418cf9046077e743772a416b6f7b826
writers:  Unify ->pre_select().

Always treat the easy cases "nothing to do", "error", and "not yet initialized"
first. For the alsa writer,  this change fixes two minor bugs:

First, if data is available but alsa has not yet been initialized, we return
from ->pre_select() without setting a delay. This is wrong, we should init
the alsa handle ASAP in this case.

Second,  on errors we wait 20ms which is both ugly and unnecessary.
Requesting a minimal delay is the right thing to do here as well.
alsa_write.c
file_write.c
oss_write.c
osx_write.c