mirror of
https://github.com/troglobit/finit.git
synced 2026-11-19 19:40:50 +00:00
plugins: pidfile: set up I/O callback on successful iwatch_init()
In case of trouble, make sure we don't have a callback set up w/o a valid file descriptor. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
e067f23ef2
commit
bc4d4b7f35
1 file changed
+3
-4
+3
-4
@@ -273,10 +273,6 @@ static plugin_t plugin = {
|
|||||||
.name = __FILE__,
|
.name = __FILE__,
|
||||||
.hook[HOOK_BASEFS_UP] = { .cb = pidfile_init },
|
.hook[HOOK_BASEFS_UP] = { .cb = pidfile_init },
|
||||||
.hook[HOOK_SVC_RECONF] = { .cb = pidfile_reconf },
|
.hook[HOOK_SVC_RECONF] = { .cb = pidfile_reconf },
|
||||||
.io = {
|
|
||||||
.cb = pidfile_callback,
|
|
||||||
.flags = PLUGIN_IO_READ,
|
|
||||||
},
|
|
||||||
.depends = { "netlink" },
|
.depends = { "netlink" },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -289,6 +285,9 @@ PLUGIN_INIT(plugin_init)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
plugin.io.fd = fd;
|
plugin.io.fd = fd;
|
||||||
|
plugin.io.cb = pidfile_callback;
|
||||||
|
plugin.io.flags = PLUGIN_IO_READ;
|
||||||
|
|
||||||
plugin_register(&plugin);
|
plugin_register(&plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user