diff options
author | Michael Adam <obnox@samba.org> | 2014-06-26 16:56:41 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-11-26 16:43:04 +0100 |
commit | d240cf7894f076a2ed2b6bc434f20a93cfbb1ca4 (patch) | |
tree | a4acf2adc68f47040d0b2432c1679f2e9a6647a0 | |
parent | 202ee81e869f4b51e1f904ef6ac3fb0030edfede (diff) | |
download | samba-d240cf7894f076a2ed2b6bc434f20a93cfbb1ca4.tar.gz |
s3:gencache: simply stabilize() a bit more: remove error from state
state.error is set to true if and only if the traverse
callback returns error (-1), and hence only if the traverse
fails.
Hence the the error state is redundant.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
-rw-r--r-- | source3/lib/gencache.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index c7646e3d14e..3d165cda3c0 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -614,7 +614,6 @@ fail: struct stabilize_state { bool written; - bool error; }; static int stabilize_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val, void *priv); @@ -660,11 +659,10 @@ bool gencache_stabilize(void) return false; } - state.error = false; state.written = false; res = tdb_traverse(cache_notrans, stabilize_fn, &state); - if ((res < 0) || state.error) { + if (res < 0) { tdb_transaction_cancel(cache_notrans); tdb_transaction_cancel(cache); return false; @@ -733,14 +731,12 @@ static int stabilize_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val, if (res != 0) { DEBUG(10, ("Transfer to gencache.tdb failed: %s\n", tdb_errorstr_compat(cache))); - state->error = true; return -1; } if (tdb_delete(cache_notrans, key) != 0) { DEBUG(10, ("tdb_delete from gencache_notrans.tdb failed: " "%s\n", tdb_errorstr_compat(cache_notrans))); - state->error = true; return -1; } return 0; |