plugins: pidfile: only scan directory if watch added successfully

Also, update condition example in comment.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-24 22:12:05 +01:00
parent e0d3aa8e06
commit f906bb357a
+5 -5
View File
@@ -138,8 +138,8 @@ static void pidfile_handle_dir(struct iwatch *iw, char *dir, char *name, int mas
if (mask & IN_CREATE) { if (mask & IN_CREATE) {
if (!iwp) { if (!iwp) {
pidfile_add_path(iw, path); if (!pidfile_add_path(iw, path))
pidfile_scandir(iw, path, sizeof(path)); pidfile_scandir(iw, path, sizeof(path));
} }
} else if (mask & IN_DELETE) { } else if (mask & IN_DELETE) {
if (iwp) if (iwp)
@@ -265,9 +265,9 @@ static void pidfile_init(void *arg)
* *
* service <net/iface/lo> /sbin/dropbear ... * service <net/iface/lo> /sbin/dropbear ...
* *
* Which provides the <pid/sbin/dropbear> condition, will not be * Which provides the <pid/dropbear> condition, will not be set by
* set by pidfile.so during `initctl reload` because dropbear is * pidfile.so during `initctl reload` because dropbear is still
* still SIGSTP:ed waiting for <net/iface/lo>. * SIGSTP:ed waiting for <net/iface/lo>.
*/ */
static plugin_t plugin = { static plugin_t plugin = {
.name = __FILE__, .name = __FILE__,