diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 18:40:31 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 11:18:35 +0200 |
commit | 5a7874e119acbc80410b2f2c1847371236c22a56 (patch) | |
tree | 86a351bdb3abfa3dc78c106f123e508e19a56fe9 /source3/utils | |
parent | 9850f256337d70401d962bb1f6d5b834a221358d (diff) | |
download | samba-5a7874e119acbc80410b2f2c1847371236c22a56.tar.gz samba-5a7874e119acbc80410b2f2c1847371236c22a56.tar.bz2 samba-5a7874e119acbc80410b2f2c1847371236c22a56.zip |
tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure. This is compatible
if we always check for < 0 instead of == -1.
Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_g_lock.c | 2 | ||||
-rw-r--r-- | source3/utils/net_serverid.c | 4 | ||||
-rw-r--r-- | source3/utils/status.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source3/utils/net_g_lock.c b/source3/utils/net_g_lock.c index bfb9a225ab..f8a7a8b620 100644 --- a/source3/utils/net_g_lock.c +++ b/source3/utils/net_g_lock.c @@ -175,7 +175,7 @@ done: TALLOC_FREE(g_ctx); TALLOC_FREE(msg); TALLOC_FREE(ev); - return ret; + return ret < 0 ? -1 : ret; } int net_g_lock(struct net_context *c, int argc, const char **argv) diff --git a/source3/utils/net_serverid.c b/source3/utils/net_serverid.c index 2c3320f40e..4159eead7a 100644 --- a/source3/utils/net_serverid.c +++ b/source3/utils/net_serverid.c @@ -37,7 +37,7 @@ static int net_serverid_list(struct net_context *c, int argc, const char **argv) { d_printf("pid unique_id msg_flags\n"); - return serverid_traverse_read(net_serverid_list_fn, NULL) ? 0 : -1; + return serverid_traverse_read(net_serverid_list_fn, NULL) > 0 ? 0 : -1; } static int net_serverid_wipe_fn(struct db_record *rec, @@ -62,7 +62,7 @@ static int net_serverid_wipe_fn(struct db_record *rec, static int net_serverid_wipe(struct net_context *c, int argc, const char **argv) { - return serverid_traverse(net_serverid_wipe_fn, NULL) ? 0 : -1; + return serverid_traverse(net_serverid_wipe_fn, NULL) > 0 ? 0 : -1; } static int net_serverid_wipedbs_conn( diff --git a/source3/utils/status.c b/source3/utils/status.c index cf625fb73f..4d37f7e66e 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -474,7 +474,7 @@ static int traverse_sessionid(const char *key, struct sessionid *session, if (result == 0) { d_printf("No locked files\n"); - } else if (result == -1) { + } else if (result < 0) { d_printf("locked file list truncated\n"); } |