diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-09-24 23:59:59 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-09-25 00:01:05 +0200 |
commit | b0a95ad2f68cfc87822420c22216d83c0abf0690 (patch) | |
tree | 8ac863eafe2c9bc1109404b975ad0f5be8b22154 /source4/lib/ldb/ldb_sqlite3 | |
parent | 31e10643c998e64c0ec432553ac9193d978e43f4 (diff) | |
download | samba-b0a95ad2f68cfc87822420c22216d83c0abf0690.tar.gz samba-b0a95ad2f68cfc87822420c22216d83c0abf0690.tar.bz2 samba-b0a95ad2f68cfc87822420c22216d83c0abf0690.zip |
Revert LDB return code patches from Matthias.
Diffstat (limited to 'source4/lib/ldb/ldb_sqlite3')
-rw-r--r-- | source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c index 7e4fe1d08d..a0e63c8da1 100644 --- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c +++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c @@ -670,10 +670,10 @@ static int lsqlite3_safe_rollback(sqlite3 *sqlite) printf("lsqlite3_safe_rollback: Error: %s\n", errmsg); free(errmsg); } - return SQLITE_ERROR; + return -1; } - return SQLITE_OK; + return 0; } /* return an eid as result */ @@ -1440,13 +1440,13 @@ static int lsql_start_trans(struct ldb_module * module) printf("lsqlite3_start_trans: error: %s\n", errmsg); free(errmsg); } - return SQLITE_ERROR; + return -1; } }; lsqlite3->trans_count++; - return SQLITE_OK; + return 0; } static int lsql_end_trans(struct ldb_module *module) @@ -1457,7 +1457,7 @@ static int lsql_end_trans(struct ldb_module *module) if (lsqlite3->trans_count > 0) { lsqlite3->trans_count--; - } else return SQLITE_ERROR; + } else return -1; if (lsqlite3->trans_count == 0) { ret = sqlite3_exec(lsqlite3->sqlite, "COMMIT;", NULL, NULL, &errmsg); @@ -1466,11 +1466,11 @@ static int lsql_end_trans(struct ldb_module *module) printf("lsqlite3_end_trans: error: %s\n", errmsg); free(errmsg); } - return SQLITE_ERROR; + return -1; } } - return SQLITE_OK; + return 0; } static int lsql_del_trans(struct ldb_module *module) @@ -1479,13 +1479,13 @@ static int lsql_del_trans(struct ldb_module *module) if (lsqlite3->trans_count > 0) { lsqlite3->trans_count--; - } else return SQLITE_ERROR; + } else return -1; if (lsqlite3->trans_count == 0) { return lsqlite3_safe_rollback(lsqlite3->sqlite); } - return SQLITE_ERROR; + return -1; } static int destructor(struct lsqlite3_private *lsqlite3) @@ -1493,7 +1493,7 @@ static int destructor(struct lsqlite3_private *lsqlite3) if (lsqlite3->sqlite) { sqlite3_close(lsqlite3->sqlite); } - return SQLITE_OK; + return 0; } static int lsql_request(struct ldb_module *module, struct ldb_request *req) @@ -1540,7 +1540,7 @@ static int initialize(struct lsqlite3_private *lsqlite3, /* create a local ctx */ local_ctx = talloc_named(lsqlite3, 0, "lsqlite3_rename local context"); if (local_ctx == NULL) { - return SQLITE_ERROR; + return -1; } schema = lsqlite3_tprintf(local_ctx, @@ -1792,7 +1792,7 @@ static int initialize(struct lsqlite3_private *lsqlite3, failed: if (rollback) lsqlite3_safe_rollback(lsqlite3->sqlite); sqlite3_close(lsqlite3->sqlite); - return SQLITE_ERROR; + return -1; } /* @@ -1860,14 +1860,14 @@ static int lsqlite3_connect(struct ldb_context *ldb, } } - return LDB_SUCCESS; + return 0; failed: if (lsqlite3->sqlite != NULL) { (void) sqlite3_close(lsqlite3->sqlite); } talloc_free(lsqlite3); - return LDB_ERR_OPERATIONS_ERROR; + return -1; } const struct ldb_backend_ops ldb_sqlite3_backend_ops = { |