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:
Joachim Nilsson
2015-10-26 03:44:43 +01:00
parent a6b78d57c0
commit f902505b5d
10 changed files with 10 additions and 2 deletions
+1
View File
@@ -39,6 +39,7 @@ static void restore(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_BASEFS_UP] = {
.cb = restore
},
+1 -1
View File
@@ -87,7 +87,7 @@ static void setup(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = "bootmisc",
.name = __FILE__,
.hook[HOOK_BASEFS_UP] = {
.cb = setup
},
+1
View File
@@ -42,6 +42,7 @@ static void setup(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_NETWORK_UP] = {
.cb = setup
},
+1
View File
@@ -41,6 +41,7 @@ static void restore(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_BASEFS_UP] = {
.cb = restore
},
+1
View File
@@ -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,
+1
View File
@@ -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,
+1
View File
@@ -66,6 +66,7 @@ static void setup(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_BASEFS_UP] = {
.cb = setup
},
+1
View File
@@ -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
View File
@@ -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", }
+1
View File
@@ -54,6 +54,7 @@ static void setup(void *UNUSED(arg))
}
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_NETWORK_UP] = {
.cb = setup
},