[Freeipa-devel] [PATCHES][SSSD] SBUS Reconnection logic
Simo Sorce
ssorce at redhat.com
Thu Mar 19 13:55:14 UTC 2009
On Wed, 2009-03-18 at 12:22 -0400, Stephen Gallagher wrote:
> +static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int
> status, void *pvt)
> +{
> + int ret;
> + struct be_ctx *be_ctx = talloc_get_type(pvt, struct be_ctx);
> +
> + /* Did we reconnect successfully? */
> + if (status == SBUS_RECONNECT_SUCCESS) {
> + /* Add the methods back to the new connection */
> + ret = sbus_conn_add_method_ctx(be_ctx->dp_ctx->scon_ctx,
> + be_ctx->dp_ctx->sm_ctx);
> + if (ret != EOK) {
> + DEBUG(0, ("Could not re-add methods on
> reconnection.\n"));
> + be_finalize(be_ctx);
> + }
don't you miss a return statement here right after be_finalize ?
> + DEBUG(1, ("Reconnected to the Data Provider.\n"));
> + return;
> + }
> +
> + /* Handle failure */
> + DEBUG(0, ("Could not reconnect to data provider.\n"));
> + /* Kill the backend and let the monitor restart it */
> + be_finalize(be_ctx);
> +}
Also why be_finalize is a void * ? Doesn't it make sense to be able to
return an errno so we can add a debug statement that explain what got
wrong ?
Simo.
--
Simo Sorce * Red Hat, Inc * New York
More information about the Freeipa-devel
mailing list