From 25705288e4b498d08e6d4af41b33ec260b96f330 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 1 Apr 2019 20:12:59 +0200 Subject: [PATCH] udevng: Track udev devices through devpath and not syspath syspath is not really needed in there, and catching devpath instead allows us to easily match against DEVPATH_OLD in follow-up patches. Furthermore, previous code was misleading retrieving syspath in remove_device() and then passing it as devpath param of check_remove(). --- plugins/udevng.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/udevng.c b/plugins/udevng.c index f334599d..1a5bcb2b 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -1432,16 +1432,16 @@ static gboolean check_remove(gpointer key, gpointer value, gpointer user_data) static void remove_device(struct udev_device *device) { - const char *syspath; + const char *devpath; - syspath = udev_device_get_syspath(device); - if (syspath == NULL) + devpath = udev_device_get_devpath(device); + if (devpath == NULL) return; - DBG("%s", syspath); + DBG("%s", devpath); g_hash_table_foreach_remove(modem_list, check_remove, - (char *) syspath); + (char *) devpath); } static gint compare_device(gconstpointer a, gconstpointer b) @@ -1555,7 +1555,7 @@ static void add_device(const char *syspath, const char *devname, struct device_info *info; struct udev_device *parent; - devpath = udev_device_get_syspath(device); + devpath = udev_device_get_devpath(device); if (devpath == NULL) return;