mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
Greatly simplify svc hook for external plugins
This commit removes a lot of unnecessary overhead for handling external service plugins. Instead of traversing the plugin array every time a service callback should run we set the plugin callback in the svc_t when the plugin is registered. Also, make sure to check for norespawn/SIGSTOP in svc_reload() as well. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f55f68d032
commit
5116cd66ef
5 files changed
+44
-67
No files matched your search
@@ -83,11 +83,8 @@ typedef struct plugin {
|
||||
|
||||
/* Service callback to be called once per lap of runloop. */
|
||||
struct {
|
||||
/* Private */
|
||||
int id; /* Service ID# to match this service plugin against, set on installation. */
|
||||
|
||||
/* Public */
|
||||
int dynamic; /* Reload (SIGHUP) on dynamic event? Set by plugin. */
|
||||
int dynamic; /* Callback wants external events as well. */
|
||||
int dynamic_stop; /* Callback allows dynamic events to stop. */
|
||||
svc_cmd_t (*cb)(svc_t *svc, int event, void *event_arg);
|
||||
} svc;
|
||||
|
||||
|
||||
Reference in new issue
Block a user