/* ldb is just a very fancy tdb, read out raw data and perform
* conversion */
ret = tdb_traverse(ltdb, convert_ldb_record, NULL);
- if (ret == -1) goto failed;
+ if (ret < 0) goto failed;
if (ltdb) {
tdb_close(ltdb);
int ret = db->traverse(db, ctx->f, ctx->private_data);
- return (ret == -1) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
+ return (ret < 0) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
}
NTSTATUS dbwrap_trans_traverse(struct db_context *db,
void *private_data)
{
int ret = db->traverse(db, f, private_data);
- return (ret == -1) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
+ return (ret < 0) ? NT_STATUS_INTERNAL_DB_CORRUPTION : NT_STATUS_OK;
}
state.written = false;
res = tdb_traverse(cache_notrans, stabilize_fn, &state);
- if ((res == -1) || state.error) {
+ if ((res < 0) || state.error) {
tdb_transaction_cancel(cache_notrans);
tdb_transaction_cancel(cache);
return false;
num_entries = tdb_traverse(tdb, validate_fn, (void *)&v_status);
if (!v_status.success) {
goto out;
- } else if (num_entries == -1) {
+ } else if (num_entries < 0) {
v_status.tdb_error = True;
v_status.success = False;
goto out;
talloc_destroy( ctx );
- return ( result != -1 );
+ return ( result >= 0 );
}
/*******************************************************************
talloc_destroy( ctx );
- return ( result != -1 );
+ return ( result >= 0 );
}
bool nt_printing_tdb_upgrade(void)
talloc_destroy(mem_ctx);
- if (rc == -1) {
+ if (rc < 0) {
return WERR_REG_IO_FAILURE;
}
fenum.username = username;
fenum.ctr3 = *ctr3;
- if (connections_traverse(pipe_enum_fn, &fenum) == -1) {
+ if (connections_traverse(pipe_enum_fn, &fenum) < 0) {
DEBUG(0,("net_enum_pipes: traverse of connections.tdb "
"failed\n"));
return WERR_NOMEM;
ret = connections_forall(count_fn, &cs);
unbecome_root();
- if (ret == -1) {
+ if (ret < 0) {
DEBUG(0,("count_current_connections: traverse of "
"connections.tdb failed\n"));
return 0;
sesslist.sessions = NULL;
ret = sessionid_traverse_read(gather_sessioninfo, (void *) &sesslist);
- if (ret == -1) {
+ if (ret < 0) {
DEBUG(3, ("Session traverse failed\n"));
SAFE_FREE(sesslist.sessions);
*session_list = NULL;
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)
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,
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(
if (result == 0) {
d_printf("No locked files\n");
- } else if (result == -1) {
+ } else if (result < 0) {
d_printf("locked file list truncated\n");
}
ret = tdb_traverse(cache->tdb, traverse_fn_get_credlist, NULL);
if (ret == 0) {
return NT_STATUS_OK;
- } else if ((ret == -1) || (wcache_cred_list == NULL)) {
+ } else if ((ret < 0) || (wcache_cred_list == NULL)) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
* putting NULL entries in the in-memory tdb
*/
ret = tdb_traverse(ltdb->tdb, delete_index, module);
- if (ret == -1) {
+ if (ret < 0) {
return LDB_ERR_OPERATIONS_ERROR;
}
/* now traverse adding any indexes for normal LDB records */
ret = tdb_traverse(ltdb->tdb, re_index, &ctx);
- if (ret == -1) {
+ if (ret < 0) {
struct ldb_context *ldb = ldb_module_get_ctx(module);
ldb_asprintf_errstring(ldb, "reindexing traverse failed: %s", ldb_errstring(ldb));
return LDB_ERR_OPERATIONS_ERROR;
ret = tdb_traverse_read(ltdb->tdb, search_func, ctx);
}
- if (ret == -1) {
+ if (ret < 0) {
return LDB_ERR_OPERATIONS_ERROR;
}