skip failing callouts
Kay Sievers
kay.sievers at vrfy.org
Thu Aug 25 18:52:47 PDT 2005
This fixes the the handling of failing or non-existing callouts specified
in fdi files. In this case HAL never initialized completely and the daemon
killed itself after the specified timeout for the callouts.
With this patch HAL skips failing callouts in the execution list instead of
waiting in the mainloop to be killed. :)
Thanks,
Kay
-------------- next part --------------
Index: hald/util.c
===================================================================
RCS file: /cvs/hal/hal/hald/util.c,v
retrieving revision 1.25
diff -u -r1.25 util.c
--- hald/util.c 22 Aug 2005 08:39:09 -0000 1.25
+++ hald/util.c 26 Aug 2005 01:45:29 -0000
@@ -598,6 +598,9 @@
return TRUE;
}
+static void
+callout_failed (HalHelperData *ed);
+
HalHelperData *
hal_util_helper_invoke (const gchar *command_line, gchar **extra_env, HalDevice *d,
gpointer data1, gpointer data2, HalHelperTerminatedCB cb, guint timeout)
@@ -680,6 +683,10 @@
&err)) {
HAL_ERROR (("Couldn't spawn '%s' err=%s!", command_line, err->message));
g_error_free (err);
+
+ /* move ahead in list */
+ callout_failed(ed);
+
g_free (ed);
ed = NULL;
} else {
@@ -1067,6 +1074,16 @@
static void callout_do_next (Callout *c);
+static void
+callout_failed (HalHelperData *ed)
+{
+ Callout *c;
+ c = (Callout *) ed->data1;
+
+ c->next_program++;
+ callout_do_next(c);
+}
+
static void
callout_terminated (HalDevice *d, gboolean timed_out, gint return_code,
gpointer data1, gpointer data2, HalHelperData *helper_data)
More information about the hal
mailing list