mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
Plugin and API init/exit for conformance
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
08e46782e5
commit
0710fdd2a3
4 files changed
+24
-6
No files matched your search
@@ -372,6 +372,11 @@ error:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int api_exit(void)
|
||||||
|
{
|
||||||
|
return shutdown(api_watcher.fd, SHUT_RDWR) ||
|
||||||
|
close(api_watcher.fd);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
|
|||||||
@@ -231,13 +231,11 @@ int main(int argc, char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
run_interactive(SETUP_DEVFS, "Populating device tree");
|
run_interactive(SETUP_DEVFS, "Populating device tree");
|
||||||
|
|
||||||
#ifndef ENABLE_STATIC
|
|
||||||
/*
|
/*
|
||||||
* Load plugins first, finit.conf may contain references to
|
* Load plugins first, finit.conf may contain references to
|
||||||
* features implemented by plugins.
|
* features implemented by plugins.
|
||||||
*/
|
*/
|
||||||
plugin_load_all(&loop, PLUGIN_PATH);
|
plugin_init(&loop, PLUGIN_PATH);
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse /etc/finit.conf, main configuration file
|
* Parse /etc/finit.conf, main configuration file
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ static void check_plugin_depends(plugin_t *plugin)
|
|||||||
}
|
}
|
||||||
#endif /* ENABLE_STATIC */
|
#endif /* ENABLE_STATIC */
|
||||||
|
|
||||||
int plugin_load_all(uev_ctx_t *ctx, char *path)
|
int plugin_init(uev_ctx_t *ctx, char *path)
|
||||||
{
|
{
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
#ifndef ENABLE_STATIC
|
#ifndef ENABLE_STATIC
|
||||||
@@ -343,6 +343,14 @@ exit:
|
|||||||
return fail;
|
return fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void plugin_exit(void)
|
||||||
|
{
|
||||||
|
plugin_t *p, *tmp;
|
||||||
|
|
||||||
|
PLUGIN_ITERATOR(p, tmp)
|
||||||
|
plugin_unregister(p);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
|
|||||||
@@ -28,16 +28,23 @@
|
|||||||
#include "svc.h"
|
#include "svc.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
uev_ctx_t *ctx; /* Main loop context */
|
/*
|
||||||
|
* Main loop context
|
||||||
|
*/
|
||||||
|
uev_ctx_t *ctx;
|
||||||
|
|
||||||
int api_init (uev_ctx_t *ctx);
|
int api_init (uev_ctx_t *ctx);
|
||||||
|
int api_exit (void);
|
||||||
|
|
||||||
int client (int argc, char *argv[]);
|
int client (int argc, char *argv[]);
|
||||||
|
|
||||||
void service_monitor (pid_t lost);
|
void service_monitor (pid_t lost);
|
||||||
|
|
||||||
void plugin_run_hook (hook_point_t no, void *arg);
|
void plugin_run_hook (hook_point_t no, void *arg);
|
||||||
void plugin_run_hooks (hook_point_t no);
|
void plugin_run_hooks (hook_point_t no);
|
||||||
int plugin_load_all (uev_ctx_t *ctx, char *path);
|
|
||||||
|
int plugin_init (uev_ctx_t *ctx, char *path);
|
||||||
|
void plugin_exit (void);
|
||||||
|
|
||||||
#endif /* FINIT_PRIVATE_H_ */
|
#endif /* FINIT_PRIVATE_H_ */
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user