udev_device->knodename = strdup(knodename);
if (udev_device->knodename == NULL)
return -ENOMEM;
+ udev_device_add_property(udev_device, "DEVNAME", udev_device->knodename);
return 0;
}
int action_set = 0;
int maj = 0;
int min = 0;
- int is_kernel = 0;
retry:
if (udev_monitor == NULL)
}
} else if (snl.nl_groups == UDEV_MONITOR_KERNEL) {
if (snl.nl_pid > 0) {
- info(udev_monitor->udev, "multicast kernel netlink message from pid %d ignored\n", snl.nl_pid);
+ info(udev_monitor->udev, "multicast kernel netlink message from pid %d ignored\n",
+ snl.nl_pid);
return NULL;
}
- is_kernel = 1;
}
}
}
udev_device = udev_device_new(udev_monitor->udev);
- if (udev_device == NULL) {
+ if (udev_device == NULL)
return NULL;
- }
while (bufpos < buflen) {
char *key;
} else if (strncmp(key, "DEVTYPE=", 8) == 0) {
udev_device_set_devtype(udev_device, &key[8]);
} else if (strncmp(key, "DEVNAME=", 8) == 0) {
- if (is_kernel)
- udev_device_set_knodename(udev_device, &key[8]);
- else
+ if (key[8] == '/')
udev_device_set_devnode(udev_device, &key[8]);
+ else
+ udev_device_set_knodename(udev_device, &key[8]);
} else if (strncmp(key, "DEVLINKS=", 9) == 0) {
char devlinks[UTIL_PATH_SIZE];
char *slink;