diff options
author | Ondrej Holy <oholy@redhat.com> | 2017-10-27 10:11:20 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2017-10-27 11:28:01 +0200 |
commit | bcd2a7ac00b5d6cd82e8ddfe9481da8edfe59e6a (patch) | |
tree | b25c674a808eb54fa45fb59bcd0e5d56a02ab312 | |
parent | 4fe3b0f8d24851145b5ceae10eb3181b2340466b (diff) | |
download | gvfs-bcd2a7ac00b5d6cd82e8ddfe9481da8edfe59e6a.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
-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 |