summaryrefslogtreecommitdiff
path: root/source3/lib/gencache.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-02-14 05:07:05 +0000
committerTim Potter <tpot@samba.org>2003-02-14 05:07:05 +0000
commit3b23695db621bdbcb84e5271d593e88ecae12901 (patch)
treef987fd972122444be31136601c051d27edd7e515 /source3/lib/gencache.c
parentafb9105c3de7fc42ab12f7545268161c5849ba16 (diff)
downloadsamba-3b23695db621bdbcb84e5271d593e88ecae12901.tar.gz
samba-3b23695db621bdbcb84e5271d593e88ecae12901.tar.bz2
samba-3b23695db621bdbcb84e5271d593e88ecae12901.zip
Simplify some return values in gencache functions:
- return ret == 0 ? True : False; + return ret == 0; and - return tdb_close(cache) ? False : True; + return tdb_close(cache) != -1; (This used to be commit 026b988b132ec76fdd3821639960658e1d36cd43)
Diffstat (limited to 'source3/lib/gencache.c')
-rw-r--r--source3/lib/gencache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 2c356d24e8..7260e477b8 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -83,10 +83,10 @@ BOOL gencache_init(void)
BOOL gencache_shutdown(void)
{
- /* tdb_close routine returns 0 on successful close */
+ /* tdb_close routine returns -1 on error */
if (!cache) return False;
DEBUG(5, ("Closing cache file\n"));
- return tdb_close(cache) ? False : True;
+ return tdb_close(cache) != -1;
}
@@ -127,7 +127,7 @@ BOOL gencache_set(const char *keystr, const char *value, time_t timeout)
SAFE_FREE(keybuf.dptr);
SAFE_FREE(databuf.dptr);
- return ret == 0 ? True : False;
+ return ret == 0;
}
@@ -182,7 +182,7 @@ BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout)
SAFE_FREE(keybuf.dptr);
SAFE_FREE(databuf.dptr);
- return ret == 0 ? True : False;
+ return ret == 0;
}
@@ -211,7 +211,7 @@ BOOL gencache_del(const char *keystr)
ret = tdb_delete(cache, keybuf);
SAFE_FREE(keybuf.dptr);
- return ret == 0 ? True : False;
+ return ret == 0;
}