]> git.proxmox.com Git - mirror_corosync.git/commitdiff
cfg: Improve error return to cfgtool -R
authorChristine Caulfield <ccaulfie@redhat.com>
Mon, 30 Mar 2020 10:28:28 +0000 (11:28 +0100)
committerJan Friesse <jfriesse@redhat.com>
Fri, 24 Apr 2020 14:26:54 +0000 (16:26 +0200)
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
exec/cfg.c

index f9c0d0341186ca11430657df6d1223b72817783e..349286fc17b22e497ff5ab53ed67ed8e05a3e235 100644 (file)
@@ -693,7 +693,7 @@ static void message_handler_req_exec_cfg_reload_config (
        res = coroparse_configparse(temp_map, &error_string);
        if (res == -1) {
                log_printf (LOGSYS_LEVEL_ERROR, "Unable to reload config file: %s", error_string);
-               res = CS_ERR_LIBRARY;
+               res = CS_ERR_INVALID_PARAM;
                goto reload_fini_nofree;
        }
 
@@ -725,7 +725,7 @@ static void message_handler_req_exec_cfg_reload_config (
        /* Calculate new node and interface definitions */
        if (totemconfig_configure_new_params(&new_config, temp_map) == -1) {
                log_printf (LOGSYS_LEVEL_ERROR, "Cannot configure new interface definitons: %s\n", error_string);
-               res = -1;
+               res = CS_ERR_INVALID_PARAM;
                goto reload_fini;
        }
 
@@ -735,7 +735,7 @@ static void message_handler_req_exec_cfg_reload_config (
        /* Validate dynamic parameters */
        if (totem_volatile_config_validate(&new_config, temp_map, &error_string) == -1) {
                log_printf (LOGSYS_LEVEL_ERROR, "Configuration is not valid: %s\n", error_string);
-               res = -1;
+               res = CS_ERR_INVALID_PARAM;
                goto reload_fini;
        }
 
@@ -744,7 +744,7 @@ static void message_handler_req_exec_cfg_reload_config (
         */
        if ( (res = icmap_copy_map(icmap_get_global_map(), temp_map)) != CS_OK) {
                log_printf (LOGSYS_LEVEL_ERROR, "Error making new config live. cmap database may be inconsistent\n");
-               res = -1;
+               /* Return res from icmap */
                goto reload_fini;
        }