Lubos Stanek has reported that the daemon may stop too slow, resulting in it
being killed by impatient init-scripts. With this patch `plugin_read_all'
checks the `loop' variable before entering each plugin's read-function. If the
loop-variable is set to non-zero it will return early, allowing the daemon to
shutdown more instantly.
curtime = time (NULL);
/* Issue all plugins */
- plugin_read_all ();
+ plugin_read_all (&loop);
if (gettimeofday (&tv_now, NULL) < 0)
{
/*
* Call `read' on all plugins (if given)
*/
-void plugin_read_all (void)
+void plugin_read_all (const int *loop)
{
plugin_t *p;
- for (p = first_plugin; p != NULL; p = p->next)
+ for (p = first_plugin; (*loop == 0) && (p != NULL); p = p->next)
if (p->read != NULL)
(*p->read) ();
}
int plugin_load_all (char *dir);
void plugin_init_all (void);
-void plugin_read_all (void);
+void plugin_read_all (const int *loop);
void plugin_register (char *type,
void (*init) (void),