s4/fsmo: Change return type from NTSTATUS to WERROR for drepl_takeFSMOrole
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Fri, 10 Sep 2010 10:44:20 +0000 (13:44 +0300)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Fri, 10 Sep 2010 10:44:20 +0000 (13:44 +0300)
This removed an unnecessary conversion of the return type in
drepl_take_FSMO_role.

source4/dsdb/repl/drepl_service.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/librpc/idl/irpc.idl

index 1423827847c94023204388ed5aeb4d9fef96cb24..2c436172f1563566b2e161851e5a617202f36f5c 100644 (file)
@@ -347,7 +347,7 @@ static NTSTATUS drepl_take_FSMO_role(struct irpc_message *msg,
 {
        struct dreplsrv_service *service = talloc_get_type(msg->private_data,
                                                           struct dreplsrv_service);
-       r->out.result = werror_to_ntstatus(dreplsrv_fsmo_role_check(service, r->in.role));
+       r->out.result = dreplsrv_fsmo_role_check(service, r->in.role);
        return NT_STATUS_OK;
 }
 
index 3397d60119c1de323aa66710dd33cab441c1b8a2..248a7203c8e214d3551d08e08aa692d33755f4e9 100644 (file)
@@ -983,7 +983,8 @@ static int rootdse_become_master(struct ldb_module *module,
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        TALLOC_CTX *tmp_ctx = talloc_new(req);
        struct loadparm_context *lp_ctx = ldb_get_opaque(ldb, "loadparm");
-       NTSTATUS status_call, status_fn;
+       NTSTATUS status_call;
+       WERROR status_fn;
        struct dcerpc_binding_handle *irpc_handle;
 
        msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx),
@@ -1002,7 +1003,7 @@ static int rootdse_become_master(struct ldb_module *module,
                return LDB_ERR_OPERATIONS_ERROR;
        }
        status_fn = r.out.result;
-       if (!NT_STATUS_IS_OK(status_fn)) {
+       if (!W_ERROR_IS_OK(status_fn)) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
        return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);
index 2b88dc749b432ebc1c9ab95ee788a1d2b4d07e64..1639d49138e1b63c6a85a260320906485f581698 100644 (file)
@@ -169,7 +169,7 @@ import "misc.idl", "security.idl", "nbt.idl";
                DREPL_PDC_MASTER
        } drepl_role_master;
 
-       NTSTATUS drepl_takeFSMORole(
+       WERROR drepl_takeFSMORole(
                [in] uint32 role
                );