From 6b85938f275aad0fbb329ee46ed718ce8b101930 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 13 Apr 2008 12:41:34 +0200 Subject: registry: change regdb_init() to return WERROR instead of bool. Michael (This used to be commit c312852abce72bc167abee8b29fc699c4a643ca7) --- source3/registry/reg_backend_db.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/registry/reg_backend_db.c') 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; } /*********************************************************************** -- cgit