chiark / gitweb /
[PATCH] check for empty symlink string
[elogind.git] / udev-add.c
index 33ee633fd8765a5fdf0d87a5b87bbb5dfa12c102..2f72613ea9fca7918b77908fd413e7d1d357cbde 100644 (file)
@@ -193,7 +193,7 @@ static int create_node(struct udevice *dev)
                symlinks = dev->symlink;
                while (1) {
                        linkname = strsep(&symlinks, " ");
-                       if (linkname == NULL)
+                       if (linkname == NULL || linkname[0] == '\0')
                                break;
 
                        strncpy(filename, udev_root, sizeof(filename));
@@ -242,9 +242,9 @@ static struct sysfs_class_device *get_class_dev(char *device_name)
        dbg("looking at '%s'", dev_path);
 
        /* open up the sysfs class device for this thing... */
-       class_dev = sysfs_open_class_device(dev_path);
+       class_dev = sysfs_open_class_device_path(dev_path);
        if (class_dev == NULL) {
-               dbg ("sysfs_open_class_device failed");
+               dbg ("sysfs_open_class_device_path failed");
                goto exit;
        }
        dbg("class_dev->name='%s'", class_dev->name);