summaryrefslogtreecommitdiff
path: root/source3/registry/reg_backend_db.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-13 12:41:34 +0200
committerMichael Adam <obnox@samba.org>2008-04-13 15:33:47 +0200
commit6b85938f275aad0fbb329ee46ed718ce8b101930 (patch)
treec4285bd7c32155ea0fb8d87412b3b147ad8a6344 /source3/registry/reg_backend_db.c
parentbcb19766d6c18b847b0576ea86c0a0e468af78af (diff)
downloadsamba-6b85938f275aad0fbb329ee46ed718ce8b101930.tar.gz
samba-6b85938f275aad0fbb329ee46ed718ce8b101930.tar.bz2
samba-6b85938f275aad0fbb329ee46ed718ce8b101930.zip
registry: change regdb_init() to return WERROR instead of bool.
Michael (This used to be commit c312852abce72bc167abee8b29fc699c4a643ca7)
Diffstat (limited to 'source3/registry/reg_backend_db.c')
-rw-r--r--source3/registry/reg_backend_db.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index fd442d6327..e30d269721 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -318,16 +318,17 @@ bool init_registry_data(void)
Open the registry database
***********************************************************************/
-bool regdb_init(void)
+WERROR regdb_init(void)
{
const char *vstring = "INFO/version";
uint32 vers_id;
+ WERROR werr;
if (regdb) {
DEBUG(10, ("regdb_init: incrementing refcount (%d)\n",
regdb_refcount));
regdb_refcount++;
- return true;
+ return WERR_OK;
}
regdb = db_open_trans(NULL, state_path("registry.tdb"), 0,
@@ -336,9 +337,10 @@ bool regdb_init(void)
regdb = db_open_trans(NULL, state_path("registry.tdb"), 0,
REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600);
if (!regdb) {
+ werr = ntstatus_to_werror(map_nt_error_from_unix(errno));
DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
state_path("registry.tdb"), strerror(errno) ));
- return false;
+ return werr;
}
DEBUG(10,("regdb_init: Successfully created registry tdb\n"));
@@ -357,14 +359,14 @@ bool regdb_init(void)
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("regdb_init: error storing %s = %d: %s\n",
vstring, REGVER_V1, nt_errstr(status)));
- return false;
+ return ntstatus_to_werror(status);
} else {
DEBUG(10, ("regdb_init: stored %s = %d\n",
vstring, REGVER_V1));
}
}
- return true;
+ return WERR_OK;
}
/***********************************************************************