mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +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:
+3
-4
@@ -273,10 +273,6 @@ static plugin_t plugin = {
|
||||
.name = __FILE__,
|
||||
.hook[HOOK_BASEFS_UP] = { .cb = pidfile_init },
|
||||
.hook[HOOK_SVC_RECONF] = { .cb = pidfile_reconf },
|
||||
.io = {
|
||||
.cb = pidfile_callback,
|
||||
.flags = PLUGIN_IO_READ,
|
||||
},
|
||||
.depends = { "netlink" },
|
||||
};
|
||||
|
||||
@@ -289,6 +285,9 @@ PLUGIN_INIT(plugin_init)
|
||||
return;
|
||||
|
||||
plugin.io.fd = fd;
|
||||
plugin.io.cb = pidfile_callback;
|
||||
plugin.io.flags = PLUGIN_IO_READ;
|
||||
|
||||
plugin_register(&plugin);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user