- strlcpy(devicepath, sysfs_path, sizeof(devicepath));
- strlcat(devicepath, udev->dev->devpath, sizeof(devicepath));
- strlcpy(filepath, devicepath, sizeof(filepath));
- strlcat(filepath, "/", sizeof(filepath));
- strlcat(filepath, file, sizeof(filepath));
+ /* a relative path is a device attribute */
+ if (file[0] != '/') {
+ strlcpy(devicepath, sysfs_path, sizeof(devicepath));
+ strlcat(devicepath, udev->dev->devpath, sizeof(devicepath));