]> git.tuebingen.mpg.de Git - osl.git/commit
Fix a design flaw in osl_rbtree_loop() and osl_rbtree_loop_reverse().
authorAndre Noll <maan@systemlinux.org>
Sat, 31 May 2008 17:18:31 +0000 (19:18 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 31 May 2008 17:18:31 +0000 (19:18 +0200)
commit666bc65dbbdad3ae9b4abbaf2683104cffe08b1e
tree1ed351a60c15a3c7cdd10a7f22dd4796dc85bfed
parent134e8d56c1c8ab60ac40ad6909cef19caf707e32
Fix a design flaw in osl_rbtree_loop() and osl_rbtree_loop_reverse().

In case the loop was terminated because the user-supplied loop function
returned a negative value, the old code returned this value back to
the caller of osl_rbtree_loop(). This is bad because osl functions
should only return osl error codes.

Moreover, the return value of the loop function might coincide with an
osl error code making it impossible to distinguish between the two
errors.

The fix is to introduce a new osl error code E_OSL_LOOP which is returned
by osl_rbtree_loop() in case the loop function returned a negative value.
It's up to the caller to save any further information about the error
in the private_data struct.
osl.c