Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
restart udev trigger when socket gets destroyed
Signed-off-by: Philippe De Swert <phdeswer@lumi.maa>
  • Loading branch information
Philippe De Swert committed Aug 15, 2011
1 parent d0f4616 commit 57cf9b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
usb-moded (0.46) unstable; urgency=low

* Restart usb trigger if the socket gets destroyed.

-- Philippe De Swert <philippe.de-swert@nokia.com> Mon, 15 Aug 2011 15:28:16 +0300

usb-moded (0.45) unstable; urgency=low

* Only signal MODE_UNDEFINED when we have actually done all the modesetting handling
Expand Down
10 changes: 9 additions & 1 deletion src/usb_moded-trigger.c
Expand Up @@ -53,6 +53,14 @@ static gboolean monitor_udev(GIOChannel *iochannel G_GNUC_UNUSED, GIOCondition c
gpointer data G_GNUC_UNUSED);
static void udev_parse(struct udev_device *dev);

static void notify_issue (gpointer data)
{
log_debug("trigger watch destroyed\n!");
/* restart trigger */
trigger_init();
}


gboolean trigger_init(void)
{
const gchar *udev_path = NULL;
Expand Down Expand Up @@ -109,7 +117,7 @@ gboolean trigger_init(void)
udev_parse(dev);

iochannel = g_io_channel_unix_new(udev_monitor_get_fd(mon));
watch_id = g_io_add_watch(iochannel, G_IO_IN, monitor_udev, NULL);
watch_id = g_io_add_watch_full(iochannel, 0, G_IO_IN, monitor_udev, NULL, notify_issue);

/* everything went well */
log_debug("Trigger enabled!\n");
Expand Down

0 comments on commit 57cf9b4

Please sign in to comment.