Skip to content

Commit 4867b72

Browse files
authored
Merge pull request #482 from vazub/plugfix
Use explicit plugin names to prevent subtle macro processing bugs
2 parents 4ce810c + 662293e commit 4867b72

16 files changed

Lines changed: 25 additions & 24 deletions

plugins/alsa-utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
static void save(void *arg)
3939
{
4040
if (rescue) {
41-
dbg("Skipping %s plugin in rescue mode.", __FILE__);
41+
dbg("Skipping %s plugin in rescue mode.", "alsa-utils");
4242
return;
4343
}
4444

@@ -51,7 +51,7 @@ static void save(void *arg)
5151
static void restore(void *arg)
5252
{
5353
if (rescue) {
54-
dbg("Skipping %s plugin in rescue mode.", __FILE__);
54+
dbg("Skipping %s plugin in rescue mode.", "alsa-utils");
5555
return;
5656
}
5757

@@ -62,7 +62,7 @@ static void restore(void *arg)
6262
}
6363

6464
static plugin_t plugin = {
65-
.name = __FILE__,
65+
.name = "alsa-utils",
6666
.hook[HOOK_BASEFS_UP] = { .cb = restore },
6767
.hook[HOOK_SHUTDOWN] = { .cb = save }
6868
};

plugins/bootmisc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static void setup(void *arg)
172172
}
173173

174174
static plugin_t plugin = {
175-
.name = __FILE__,
175+
.name = "bootmisc",
176176
.hook[HOOK_MOUNT_POST] = { .cb = clean },
177177
.hook[HOOK_BASEFS_UP] = { .cb = setup },
178178
.depends = { "pidfile" },

plugins/dbus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void setup(void *arg)
106106
char *cmd;
107107

108108
if (rescue) {
109-
dbg("Skipping %s plugin in rescue mode.", __FILE__);
109+
dbg("Skipping %s plugin in rescue mode.", "dbus");
110110
return;
111111
}
112112

@@ -164,7 +164,7 @@ static void setup(void *arg)
164164
}
165165

166166
static plugin_t plugin = {
167-
.name = __FILE__,
167+
.name = "dbus",
168168
.hook[HOOK_SVC_PLUGIN] = { .cb = setup },
169169
};
170170

plugins/hook-scripts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void hscript_shutdown(void *arg)
7979
}
8080

8181
static plugin_t plugin = {
82-
.name = __FILE__,
82+
.name = "hook-scripts",
8383
.hook[HOOK_BANNER] = { .cb = hscript_banner },
8484
.hook[HOOK_ROOTFS_UP] = { .cb = hscript_rootfs_up },
8585
.hook[HOOK_MOUNT_ERROR] = { .cb = hscript_mount_error },

plugins/modprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static void coldplug(void *arg)
228228
}
229229

230230
static plugin_t plugin = {
231-
.name = __FILE__,
231+
.name = "modprobe",
232232
.hook[HOOK_BASEFS_UP] = { .cb = coldplug },
233233
.depends = { "bootmisc", }
234234
};

plugins/modules-load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static void load(void *arg)
213213
}
214214

215215
static plugin_t plugin = {
216-
.name = __FILE__,
216+
.name = "modules-load",
217217
.hook[HOOK_SVC_PLUGIN] = { .cb = load },
218218
};
219219

plugins/netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static void nl_enumerate(void *arg)
426426
}
427427

428428
static plugin_t plugin = {
429-
.name = __FILE__,
429+
.name = "netlink",
430430
.hook[HOOK_SVC_RECONF] = { .cb = nl_reconf },
431431
.hook[HOOK_SVC_PLUGIN] = { .cb = nl_enumerate },
432432
.io = {

plugins/pidfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void pidfile_init(void *arg)
335335
* SIGSTP:ed (in state PAUSED) waiting for <net/iface/lo>.
336336
*/
337337
static plugin_t plugin = {
338-
.name = __FILE__,
338+
.name = "pidfile",
339339
.hook[HOOK_BASEFS_UP] = { .cb = pidfile_init },
340340
.hook[HOOK_SVC_RECONF] = { .cb = pidfile_reconf },
341341
.depends = { "netlink" }, /* bootmisc depends on us */

plugins/procps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void setup(void *arg)
4343
glob_t gl;
4444

4545
if (rescue) {
46-
dbg("Skipping %s plugin in rescue mode.", __FILE__);
46+
dbg("Skipping %s plugin in rescue mode.", "procps");
4747
return;
4848
}
4949

@@ -69,7 +69,7 @@ static void setup(void *arg)
6969
}
7070

7171
static plugin_t plugin = {
72-
.name = __FILE__,
72+
.name = "procps",
7373
.hook[HOOK_BASEFS_UP] = {
7474
.cb = setup
7575
},

plugins/resolvconf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void setup(void *arg)
5151
}
5252

5353
static plugin_t plugin = {
54-
.name = __FILE__,
54+
.name = "resolvconf",
5555
.hook[HOOK_BASEFS_UP] = {
5656
.cb = setup
5757
},

0 commit comments

Comments
 (0)