mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Declare name for all plugins, needed for static builds.
When building a static Finit the plugins do not get a unique name automatically from the file. This led to only the first plugin being loaded, since its name was 'unknown' it was registered as such and all other plugins conflicted, since 'unknown' was already ... known and loaded. This patch gives all plugins a default name, __FILE__, making it possible to use all of them when building a static Finit. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -39,6 +39,7 @@ static void restore(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = restore
|
||||
},
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ static void setup(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = "bootmisc",
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = setup
|
||||
},
|
||||
|
||||
@@ -42,6 +42,7 @@ static void setup(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_NETWORK_UP] = {
|
||||
.cb = setup
|
||||
},
|
||||
|
||||
@@ -41,6 +41,7 @@ static void restore(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = restore
|
||||
},
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
static void parse(void *arg, int fd, int events);
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.io = {
|
||||
.cb = parse,
|
||||
.flags = PLUGIN_IO_READ,
|
||||
|
||||
@@ -180,6 +180,7 @@ static void nl_callback(void *UNUSED(arg), int sd, int UNUSED(events))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.io = {
|
||||
.cb = nl_callback,
|
||||
.flags = PLUGIN_IO_READ,
|
||||
|
||||
@@ -66,6 +66,7 @@ static void setup(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = {
|
||||
.cb = setup
|
||||
},
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
static void watcher(void *arg, int fd, int events);
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.io = {
|
||||
.cb = watcher,
|
||||
.flags = PLUGIN_IO_READ,
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ static void save(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = "urandom",
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = { .cb = setup },
|
||||
.hook[HOOK_SHUTDOWN] = { .cb = save },
|
||||
.depends = { "bootmisc", }
|
||||
|
||||
@@ -54,6 +54,7 @@ static void setup(void *UNUSED(arg))
|
||||
}
|
||||
|
||||
static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_NETWORK_UP] = {
|
||||
.cb = setup
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user