Use a proper udev function for getting network device
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 21 Jul 2009 09:38:35 +0000 (11:38 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 21 Jul 2009 09:38:35 +0000 (11:38 +0200)
src/udev.c

index 4decd7d5d6f778ecbb82203765f07f8309c2314d..cf0f3bb1f760d3f1b03e44d00d272f6f9f883a92 100644 (file)
@@ -286,11 +286,9 @@ char *__connman_udev_get_devtype(const char *ifname)
 {
        struct udev_device *device;
        const char *devtype;
-       char syspath[128];
 
-       snprintf(syspath, sizeof(syspath) - 1, "/sys/class/net/%s", ifname);
-
-       device = udev_device_new_from_syspath(udev_ctx, syspath);
+       device = udev_device_new_from_subsystem_sysname(udev_ctx,
+                                                       "net", ifname);
        if (device == NULL)
                return NULL;