diff options
author | Ondrej Holy <oholy@redhat.com> | 2017-10-27 10:11:20 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2017-10-27 10:11:20 +0200 |
commit | 9f8561de232332979bedfea94b1df927f271d070 (patch) | |
tree | 9386863c5c60b082f7b8e7937e862aeb98d801c1 /monitor/gphoto2 | |
parent | 0c7f803b592a2f472714c5e7c97b92515aef0620 (diff) | |
download | gvfs-9f8561de232332979bedfea94b1df927f271d070.tar.gz |
gphoto2: Fix volume removal with current udev behavior
UDev events for devices without ID_GPHOTO2 property are ignored.
Although ID_GPHOTO2 seems don't have to be set for device when removing
and thus the volume is not removed. Let's ignore ID_GPHOTO2 when removing.
https://bugzilla.gnome.org/show_bug.cgi?id=789491
Diffstat (limited to 'monitor/gphoto2')
-rw-r--r-- | monitor/gphoto2/ggphoto2volumemonitor.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c index f4fae8b7..06e07ab6 100644 --- a/monitor/gphoto2/ggphoto2volumemonitor.c +++ b/monitor/gphoto2/ggphoto2volumemonitor.c @@ -246,17 +246,12 @@ on_uevent (GUdevClient *client, /* g_debug ("on_uevent: action=%s, device=%s", action, g_udev_device_get_device_file(device)); */ - /* filter out uninteresting events */ - if (!g_udev_device_has_property (device, "ID_GPHOTO2")) - { - /* g_debug ("on_uevent: discarding, not ID_GPHOTO2"); */ - return; - } - - if (strcmp (action, "add") == 0) - gudev_add_camera (monitor, device, TRUE); - else if (strcmp (action, "remove") == 0) - gudev_remove_camera (monitor, device); + if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_GPHOTO2")) + gudev_add_camera (monitor, device, TRUE); + else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL) + gudev_remove_camera (monitor, device); + else + g_debug ("on_uevent: discarding"); } /* Find all attached gphoto supported cameras; this is called on startup |