]> err.no Git - systemd/commitdiff
device: fall back to device node path as description instead of kernel name
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 00:03:24 +0000 (01:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 14 Feb 2010 00:03:24 +0000 (01:03 +0100)
device.c

index c5901c95ff67697973ed4d22bc7bb65ddb1f5a9b..1b0b50fd4e796752826d79a278c4d322c7430919 100644 (file)
--- a/device.c
+++ b/device.c
@@ -162,9 +162,12 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u
                 }
 
                 if ((model = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE")) ||
-                    (model = udev_device_get_property_value(dev, "ID_MODEL")))
+                    (model = udev_device_get_property_value(dev, "ID_MODEL"))) {
                         if ((r = unit_set_description(u, model)) < 0)
                                 goto fail;
+                } else if (dn)
+                        if ((r = unit_set_description(u, dn)) < 0)
+                                goto fail;
 
                 unit_add_to_load_queue(u);
         } else {