core: modernize device_update_description() a bit

This commit is contained in:
Lennart Poettering
2018-06-07 13:36:19 +02:00
parent 43ba7d71e5
commit ea8ec43bb5
+6 -7
View File
@@ -324,19 +324,18 @@ static int device_update_description(Unit *u, struct udev_device *dev, const cha
_cleanup_free_ char *j;
j = strjoin(model, " ", label);
if (j)
r = unit_set_description(u, j);
else
r = -ENOMEM;
if (!j)
return log_oom();
r = unit_set_description(u, j);
} else
r = unit_set_description(u, model);
} else
r = unit_set_description(u, path);
if (r < 0)
log_unit_error_errno(u, r, "Failed to set device description: %m");
return log_unit_error_errno(u, r, "Failed to set device description: %m");
return r;
return 0;
}
static int device_add_udev_wants(Unit *u, struct udev_device *dev) {