mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-04 22:53:02 +02:00
src/confd: standardize on 'fail:' as cleanup label on failure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -46,15 +46,15 @@ static inline void print_val(sr_val_t *val)
|
||||
|
||||
#define REGISTER_CHANGE(s,m,x,f,c,a,u) \
|
||||
if ((rc = register_change(s, m, x, f, c, a, u))) \
|
||||
goto err
|
||||
goto fail
|
||||
|
||||
#define REGISTER_OPER(s,m,x,c,a,f,u) \
|
||||
if ((rc = register_oper(s, m, x, c, a, f, u))) \
|
||||
goto err
|
||||
goto fail
|
||||
|
||||
#define REGISTER_RPC(s,x,c,a,u) \
|
||||
if ((rc = register_rpc(s, x, c, a, u))) \
|
||||
goto err
|
||||
goto fail
|
||||
|
||||
struct confd {
|
||||
sr_session_ctx_t *session;
|
||||
|
||||
@@ -295,7 +295,7 @@ int ietf_interfaces_init(struct confd *confd)
|
||||
|
||||
rc = srx_require_modules(confd->conn, ietf_if_reqs);
|
||||
if (rc)
|
||||
goto err;
|
||||
goto fail;
|
||||
|
||||
ifprobe();
|
||||
|
||||
@@ -308,7 +308,7 @@ int ietf_interfaces_init(struct confd *confd)
|
||||
ifinit(confd->session);
|
||||
|
||||
return SR_ERR_OK;
|
||||
err:
|
||||
fail:
|
||||
ERROR("init failed: %s", sr_strerror(rc));
|
||||
sr_unsubscribe(confd->sub);
|
||||
|
||||
|
||||
@@ -636,16 +636,16 @@ int ietf_system_init(struct confd *confd)
|
||||
if (aug_load_file(confd->aug, "/etc/hostname") ||
|
||||
aug_load_file(confd->aug, "/etc/hosts")) {
|
||||
ERROR("ietf-system: Augeas initialization failed");
|
||||
goto err;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
rc = sr_install_module(confd->conn, YANG_PATH_"/ietf-system@2014-08-06.yang", NULL, features);
|
||||
if (rc)
|
||||
goto err;
|
||||
goto fail;
|
||||
/* Augment to ietf-systems */
|
||||
rc = sr_install_module(confd->conn, YANG_PATH_"/infix-system@2014-08-06.yang", NULL, NULL);
|
||||
if (rc)
|
||||
goto err;
|
||||
goto fail;
|
||||
|
||||
REGISTER_CHANGE(confd->session, "ietf-system", "/ietf-system:system/hostname", 0, change_hostname, confd, &confd->sub);
|
||||
REGISTER_CHANGE(confd->session, "ietf-system", "/ietf-system:system/infix-system:motd", 0, change_motd, confd, &confd->sub);
|
||||
@@ -661,7 +661,7 @@ int ietf_system_init(struct confd *confd)
|
||||
REGISTER_RPC(confd->session, "/ietf-system:set-current-datetime", rpc_set_datetime, NULL, &confd->sub);
|
||||
|
||||
return SR_ERR_OK;
|
||||
err:
|
||||
fail:
|
||||
ERROR("init failed: %s", sr_strerror(rc));
|
||||
sr_unsubscribe(confd->sub);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user