summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/udev-event.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/udev-event.c b/src/udev-event.c
index 0b6db30eda..7ecaf85536 100644
--- a/src/udev-event.c
+++ b/src/udev-event.c
@@ -349,12 +349,15 @@ subst:
case SUBST_NAME: {
if (event->name != NULL) {
l = util_strpcpy(&s, l, event->name);
- dbg(event->udev, "substitute custom name '%s'\n", event->name);
- } else {
+ dbg(event->udev, "substitute custom node name '%s'\n", event->name);
+ } else if (udev_device_get_devnode(dev) != NULL) {
size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
l = util_strpcpy(&s, l, &udev_device_get_devnode(dev)[devlen]);
- dbg(event->udev, "substitute name'%s'\n", &udev_device_get_devnode(dev)[devlen]);
+ dbg(event->udev, "substitute node name'%s'\n", &udev_device_get_devnode(dev)[devlen]);
+ } else {
+ l = util_strpcpy(&s, l, udev_device_get_sysname(dev));
+ dbg(event->udev, "substitute device name'%s'\n", udev_device_get_sysname(dev));
}
break;
}