From: benno Date: Sun, 2 Jul 2017 14:27:30 +0000 (+0000) Subject: Rename one of the "always" variables to "body" for improved readability. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=138e089f0d1ec14e8ec4503a6e536f40beca60d4;p=openbsd Rename one of the "always" variables to "body" for improved readability. No functional change. from Rob Pierce. ok stsp@ and me --- diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c index 1e0267a49a1..ff2ed984fae 100644 --- a/usr.sbin/ifstated/ifstated.c +++ b/usr.sbin/ifstated/ifstated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifstated.c,v 1.45 2017/06/28 11:10:08 benno Exp $ */ +/* $OpenBSD: ifstated.c,v 1.46 2017/07/02 14:27:30 benno Exp $ */ /* * Copyright (c) 2004 Marco Pfatschbacher @@ -218,7 +218,7 @@ load_config(void) conf->nextstate = conf->curstate; conf->curstate = NULL; while (state_change()) - do_action(conf->curstate->always); + do_action(conf->curstate->body); } return (0); } @@ -530,9 +530,9 @@ eval_state(struct ifsd_state *state) struct ifsd_external *external = TAILQ_FIRST(&state->external_tests); if (external == NULL || external->lastexec >= state->entered || external->lastexec == 0) { - do_action(state->always); + do_action(state->body); while (state_change()) - do_action(conf->curstate->always); + do_action(conf->curstate->body); } } @@ -639,12 +639,12 @@ clear_config(struct ifsd_config *oconf) while ((state = TAILQ_FIRST(&oconf->states)) != NULL) { TAILQ_REMOVE(&oconf->states, state, entries); remove_action(state->init, state); - remove_action(state->always, state); + remove_action(state->body, state); free(state->name); free(state); } remove_action(oconf->always.init, &oconf->always); - remove_action(oconf->always.always, &oconf->always); + remove_action(oconf->always.body, &oconf->always); free(oconf); } diff --git a/usr.sbin/ifstated/ifstated.h b/usr.sbin/ifstated/ifstated.h index 16173cca761..a096f663bfc 100644 --- a/usr.sbin/ifstated/ifstated.h +++ b/usr.sbin/ifstated/ifstated.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ifstated.h,v 1.12 2017/06/28 11:10:08 benno Exp $ */ +/* $OpenBSD: ifstated.h,v 1.13 2017/07/02 14:27:30 benno Exp $ */ /* * Copyright (c) 2004 Ryan McBride @@ -110,7 +110,7 @@ struct ifsd_state { struct ifsd_external_list external_tests; TAILQ_ENTRY(ifsd_state) entries; struct ifsd_action *init; - struct ifsd_action *always; + struct ifsd_action *body; u_int32_t entered; char *name; }; diff --git a/usr.sbin/ifstated/parse.y b/usr.sbin/ifstated/parse.y index 254ef740323..e90b4508106 100644 --- a/usr.sbin/ifstated/parse.y +++ b/usr.sbin/ifstated/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.41 2017/06/18 12:03:47 benno Exp $ */ +/* $OpenBSD: parse.y,v 1.42 2017/07/02 14:27:30 benno Exp $ */ /* * Copyright (c) 2004 Ryan McBride @@ -245,9 +245,9 @@ init : INIT { curaction = conf->always.init; } action_block { if (curstate != NULL) - curaction = curstate->always; + curaction = curstate->body; else - curaction = conf->always.always; + curaction = conf->always.body; } ; @@ -339,11 +339,11 @@ state : STATE string { init_state(state); state->name = $2; curstate = state; - curaction = state->always; + curaction = state->body; } optnl '{' optnl stateopts_l '}' { TAILQ_INSERT_TAIL(&conf->states, curstate, entries); curstate = NULL; - curaction = conf->always.always; + curaction = conf->always.body; } ; @@ -747,7 +747,7 @@ parse_config(char *filename, int opts) TAILQ_INIT(&conf->states); init_state(&conf->always); - curaction = conf->always.always; + curaction = conf->always.body; conf->opts = opts; yyparse(); @@ -755,7 +755,7 @@ parse_config(char *filename, int opts) /* Link states */ TAILQ_FOREACH(state, &conf->states, entries) { link_states(state->init); - link_states(state->always); + link_states(state->body); } errors = file->errors; @@ -928,10 +928,10 @@ init_state(struct ifsd_state *state) state->init->type = IFSD_ACTION_CONDITION; TAILQ_INIT(&state->init->act.c.actions); - if ((state->always = calloc(1, sizeof(*state->always))) == NULL) + if ((state->body = calloc(1, sizeof(*state->body))) == NULL) err(1, "init_state: calloc"); - state->always->type = IFSD_ACTION_CONDITION; - TAILQ_INIT(&state->always->act.c.actions); + state->body->type = IFSD_ACTION_CONDITION; + TAILQ_INIT(&state->body->act.c.actions); } struct ifsd_ifstate *