Second diff to rename additional "always" variable in struct ifsd_config.

Requested by stsp@.

Rob

Index: ifstated.c
===================================================================
RCS file: /cvs/src/usr.sbin/ifstated/ifstated.c,v
retrieving revision 1.47
diff -u -p -r1.47 ifstated.c
--- ifstated.c  2 Jul 2017 14:28:45 -0000       1.47
+++ ifstated.c  2 Jul 2017 14:47:49 -0000
@@ -207,11 +207,11 @@ load_config(void)
        if (conf != NULL)
                clear_config(conf);
        conf = newconf;
-       conf->always.entered = time(NULL);
+       conf->initstate.entered = time(NULL);
        fetch_state();
-       external_evtimer_setup(&conf->always, IFSD_EVTIMER_ADD);
-       adjust_external_expressions(&conf->always);
-       eval_state(&conf->always);
+       external_evtimer_setup(&conf->initstate, IFSD_EVTIMER_ADD);
+       adjust_external_expressions(&conf->initstate);
+       eval_state(&conf->initstate);
        if (conf->curstate != NULL) {
                log_info("initial state: %s", conf->curstate->name);
                conf->curstate->entered = time(NULL);
@@ -250,7 +250,7 @@ rt_msg_handler(int fd, short event, void
 void
 sigchld_handler(int fd, short event, void *arg)
 {
-       check_external_status(&conf->always);
+       check_external_status(&conf->initstate);
        if (conf->curstate != NULL)
                check_external_status(conf->curstate);
 }
@@ -463,8 +463,8 @@ scan_ifstate(int ifindex, int s, int do_
        struct ifsd_state *state;
        int cur_eval = 0;
 
-       if (scan_ifstate_single(ifindex, s, &conf->always) && do_eval)
-               eval_state(&conf->always);
+       if (scan_ifstate_single(ifindex, s, &conf->initstate) && do_eval)
+               eval_state(&conf->initstate);
        TAILQ_FOREACH(state, &conf->states, entries) {
                if (scan_ifstate_single(ifindex, s, state) &&
                    (do_eval && state == conf->curstate))
@@ -635,7 +635,7 @@ clear_config(struct ifsd_config *oconf)
 {
        struct ifsd_state *state;
 
-       external_evtimer_setup(&conf->always, IFSD_EVTIMER_DEL);
+       external_evtimer_setup(&conf->initstate, IFSD_EVTIMER_DEL);
        if (conf != NULL && conf->curstate != NULL)
                external_evtimer_setup(conf->curstate, IFSD_EVTIMER_DEL);
        while ((state = TAILQ_FIRST(&oconf->states)) != NULL) {
@@ -645,8 +645,8 @@ clear_config(struct ifsd_config *oconf)
                free(state->name);
                free(state);
        }
-       remove_action(oconf->always.init, &oconf->always);
-       remove_action(oconf->always.body, &oconf->always);
+       remove_action(oconf->initstate.init, &oconf->initstate);
+       remove_action(oconf->initstate.body, &oconf->initstate);
        free(oconf);
 }
 
Index: ifstated.h
===================================================================
RCS file: /cvs/src/usr.sbin/ifstated/ifstated.h,v
retrieving revision 1.14
diff -u -p -r1.14 ifstated.h
--- ifstated.h  2 Jul 2017 14:30:35 -0000       1.14
+++ ifstated.h  2 Jul 2017 14:47:49 -0000
@@ -117,7 +117,7 @@ struct ifsd_state {
 TAILQ_HEAD(ifsd_state_list, ifsd_state);
 
 struct ifsd_config {
-       struct ifsd_state                always;
+       struct ifsd_state                initstate;
        struct ifsd_state_list           states;
        struct ifsd_state               *curstate;
        struct ifsd_state               *nextstate;

Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/ifstated/parse.y,v
retrieving revision 1.42
diff -u -p -r1.42 parse.y
--- parse.y     2 Jul 2017 14:27:30 -0000       1.42
+++ parse.y     2 Jul 2017 14:47:49 -0000
@@ -242,12 +242,12 @@ init              : INIT {
                        if (curstate != NULL)
                                curaction = curstate->init;
                        else
-                               curaction = conf->always.init;
+                               curaction = conf->initstate.init;
                } action_block {
                        if (curstate != NULL)
                                curaction = curstate->body;
                        else
-                               curaction = conf->always.body;
+                               curaction = conf->initstate.body;
                }
                ;
 
@@ -343,7 +343,7 @@ state               : STATE string {
                } optnl '{' optnl stateopts_l '}' {
                        TAILQ_INSERT_TAIL(&conf->states, curstate, entries);
                        curstate = NULL;
-                       curaction = conf->always.body;
+                       curaction = conf->initstate.body;
                }
                ;
 
@@ -746,8 +746,8 @@ parse_config(char *filename, int opts)
 
        TAILQ_INIT(&conf->states);
 
-       init_state(&conf->always);
-       curaction = conf->always.body;
+       init_state(&conf->initstate);
+       curaction = conf->initstate.body;
        conf->opts = opts;
 
        yyparse();
@@ -943,7 +943,7 @@ new_ifstate(u_short ifindex, int s)
        if (curstate != NULL)
                state = curstate;
        else
-               state = &conf->always;
+               state = &conf->initstate;
 
        TAILQ_FOREACH(ifstate, &state->interface_states, entries)
                if (ifstate->ifindex == ifindex && ifstate->ifstate == s)
@@ -970,7 +970,7 @@ new_external(char *command, u_int32_t fr
        if (curstate != NULL)
                state = curstate;
        else
-               state = &conf->always;
+               state = &conf->initstate;
 
        TAILQ_FOREACH(external, &state->external_tests, entries)
                if (strcmp(external->command, command) == 0 &&

Reply via email to