mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
Refactor state machine control functions
This refactor should have been done years ago when we first introduced the big state machine. The old functions service_runvel() and the oddly named service_reload_dynamic() are actually state machine control fns, so let relocate them. Also in this commit, remove the global variable 'sm' and rename a few of the critical functions to better names. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
10 files changed
+135
-138
No files matched your search
@@ -94,6 +94,7 @@
|
||||
#include "private.h"
|
||||
#include "sig.h"
|
||||
#include "service.h"
|
||||
#include "sm.h"
|
||||
#include "util.h"
|
||||
#include "utmp-api.h"
|
||||
|
||||
@@ -444,7 +445,7 @@ static void sighup_cb(uev_t *w, void *arg, int events)
|
||||
api_init(w->ctx);
|
||||
|
||||
/* INIT_CMD_RELOAD: 'init q', 'initctl reload', and SIGHUP */
|
||||
service_reload_dynamic();
|
||||
sm_reload();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -528,7 +529,7 @@ static void sigusr2_cb(uev_t *w, void *arg, int events)
|
||||
}
|
||||
|
||||
halt = SHUT_OFF;
|
||||
service_runlevel(0);
|
||||
sm_runlevel(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -551,7 +552,7 @@ static void sigterm_cb(uev_t *w, void *arg, int events)
|
||||
}
|
||||
|
||||
halt = SHUT_REBOOT;
|
||||
service_runlevel(6);
|
||||
sm_runlevel(6);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user