void *context;
};
+static int child_wait_refcount = 0;
+
/* pid_t => wait */
static HASH_TABLE(void *, struct child_wait *) child_pids;
void child_wait_init(void)
{
+ if (child_wait_refcount++ > 0) return;
+
hash_table_create_direct(&child_pids, default_pool, 0);
lib_signals_set_handler(SIGCHLD, LIBSIG_FLAGS_SAFE,
void *key;
struct child_wait *value;
+ i_assert(child_wait_refcount > 0);
+ if (--child_wait_refcount > 0) return;
+
lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
iter = hash_table_iterate_init(child_pids);