- if (major(udev_device_get_devnum(event->dev))) {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
-
- if (strcmp(name_str, &udev_device_get_devnode(event->dev)[devlen]) != 0) {
- log_error("NAME=\"%s\" ignored, kernel device nodes "
- "can not be renamed; please fix it in %s:%u\n", name,
- &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
- break;
- }
+ if (major(udev_device_get_devnum(event->dev)) &&
+ (!streq(name_str, udev_device_get_devnode(event->dev) + strlen(TEST_PREFIX "/dev/")))) {
+ log_error("NAME=\"%s\" ignored, kernel device nodes "
+ "can not be renamed; please fix it in %s:%u\n", name,
+ &rules->buf[rule->rule.filename_off], rule->rule.filename_line);
+ break;