summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2017-10-31 17:31:05 +0100
committerOndrej Holy <oholy@redhat.com>2018-04-03 16:25:57 +0200
commitbd7667dd0f791461ca61a11591df66c6f4378f09 (patch)
treedad5921a8b6f6d7fad1cce7772bcc64478875fa2
parent50e251b1a7349330190560aa4d3e19cad6fe2472 (diff)
downloadgvfs-gnome-3-22.tar.gz
monitor: Remove device file checksgnome-3-22
The device file checks were added by mistake and it is not clear whether it can't have some side-effect. Let's remove them and use g_strcmp0 for sysfs path comparison for sure... https://bugzilla.gnome.org/show_bug.cgi?id=789491
-rw-r--r--monitor/gphoto2/ggphoto2volume.c2
-rw-r--r--monitor/gphoto2/ggphoto2volumemonitor.c2
-rw-r--r--monitor/mtp/gmtpvolume.c2
-rw-r--r--monitor/mtp/gmtpvolumemonitor.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/monitor/gphoto2/ggphoto2volume.c b/monitor/gphoto2/ggphoto2volume.c
index 50d9b0cc..90389664 100644
--- a/monitor/gphoto2/ggphoto2volume.c
+++ b/monitor/gphoto2/ggphoto2volume.c
@@ -421,7 +421,7 @@ g_gphoto2_volume_has_path (GGPhoto2Volume *volume,
G_LOCK (gphoto2_volume);
res = FALSE;
if (gphoto2_volume->device != NULL)
- res = strcmp (g_udev_device_get_sysfs_path (gphoto2_volume->device), sysfs_path) == 0;
+ res = g_strcmp0 (g_udev_device_get_sysfs_path (gphoto2_volume->device), sysfs_path) == 0;
G_UNLOCK (gphoto2_volume);
return res;
}
diff --git a/monitor/gphoto2/ggphoto2volumemonitor.c b/monitor/gphoto2/ggphoto2volumemonitor.c
index 13c41a5a..54c5aa2c 100644
--- a/monitor/gphoto2/ggphoto2volumemonitor.c
+++ b/monitor/gphoto2/ggphoto2volumemonitor.c
@@ -292,7 +292,7 @@ on_uevent (GUdevClient *client,
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)
+ else if (g_strcmp0 (action, "remove") == 0)
gudev_remove_camera (monitor, device);
else
g_debug ("on_uevent: discarding");
diff --git a/monitor/mtp/gmtpvolume.c b/monitor/mtp/gmtpvolume.c
index cfd77590..681029fa 100644
--- a/monitor/mtp/gmtpvolume.c
+++ b/monitor/mtp/gmtpvolume.c
@@ -209,7 +209,7 @@ g_mtp_volume_has_path (GMtpVolume *volume,
G_LOCK (mtp_volume);
res = FALSE;
if (mtp_volume->device != NULL)
- res = strcmp (g_udev_device_get_sysfs_path (mtp_volume->device), sysfs_path) == 0;
+ res = g_strcmp0 (g_udev_device_get_sysfs_path (mtp_volume->device), sysfs_path) == 0;
G_UNLOCK (mtp_volume);
return res;
}
diff --git a/monitor/mtp/gmtpvolumemonitor.c b/monitor/mtp/gmtpvolumemonitor.c
index bfd9e29f..1e73db73 100644
--- a/monitor/mtp/gmtpvolumemonitor.c
+++ b/monitor/mtp/gmtpvolumemonitor.c
@@ -210,7 +210,7 @@ on_uevent (GUdevClient *client, gchar *action, GUdevDevice *device, gpointer use
if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_MTP_DEVICE"))
gudev_add_device (monitor, device, TRUE);
- else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL)
+ else if (g_strcmp0 (action, "remove") == 0)
gudev_remove_device (monitor, device);
else
g_debug ("on_uevent: discarding");