Re: [PATCH] Honor exec_init_fn call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ACk with a minor nitpick


> @@ -276,9 +277,11 @@ static int quorum_exec_init_fn (struct corosync_api_v1 *api)
>  			    "Using quorum provider %s", quorum_module);
>  
>  		if (strcmp (quorum_module, "corosync_votequorum") == 0) {
> -			if (votequorum_init (api, quorum_api_set_quorum) == CS_OK) {
> -				quorum_type = 1;
> +			error = votequorum_init (api, quorum_api_set_quorum);
> +			if (error) {
> +				return (error);
>  			}
> +			quorum_type = 1;
>  		}
>  		if (strcmp (quorum_module, "corosync_ykd") == 0) {
>  			if (ykd_init (api, quorum_api_set_quorum) == CS_OK) {
> @@ -288,7 +291,8 @@ static int quorum_exec_init_fn (struct corosync_api_v1 *api)
>  
>  		if (quorum_type == 0) {
>  			log_printf (LOGSYS_LEVEL_CRIT, 
> -				    "Quorum provider: %s failed to initialize", quorum_module);
> +				"Quorum provider: %s failed to initialize.",
> +				 quorum_module);
>  		}
>  	}

^^ I don't like this error handling here. It's inconsistent IMHO.

ykd_init should also return char *error and instead of:

if (error) {
  return error;
}

and

if (quorum_type == 0) {
...


we can simplify the error handling by:

if (error) {
  log_printf( .. QUorum provider foobar failed to init);
  return (error);
}

Anyway either fix it at merge time, or just let me know and I'll do it
tomorrow.

Fabio
_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux