nmdb: Make cache_set(), cache_cas() and cache_incr() return 0 on success
commitd7d5711ad5ba7c0b72083174452d0044b6e99182
authorAlberto Bertogli <albertito@blitiri.com.ar>
Wed, 14 Apr 2010 20:14:56 +0000 (14 17:14 -0300)
committerAlberto Bertogli <albertito@blitiri.com.ar>
Wed, 14 Apr 2010 21:10:42 +0000 (14 18:10 -0300)
treed23eb73db1ac718fdfdfef2a2347801fb888298c
parent57a94ccd56a05cc2e8b03da3ab30523bf821a362
nmdb: Make cache_set(), cache_cas() and cache_incr() return 0 on success

cache_set() and cache_cas() return different values according to the
result. One of them is always success, the rest are different errors.

A traditional C convention is to encode that using 0 for success, and
< 0 for errors.

This patch updates their APIs to follow that convention.

While at it, it also simplifies some of the error paths, to make them return
directly instead of performing unnecessary gotos.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
nmdb/cache.c
nmdb/parse.c