summaryrefslogtreecommitdiff
path: root/src/core/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-10-25 00:29:05 +0200
committerLennart Poettering <lennart@poettering.net>2016-11-02 11:29:59 -0600
commita581e45ae8f9bb5c6693c23c78bc070aa15d0c8a (patch)
treec881c7d827d8789d4cbdebfd8df678731afc8e6e /src/core/device.c
parent11222d0fe0b5abb0cef65359b979e0c7f50129f3 (diff)
unit: unify some code with new unit_new_for_name() call
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 8a3e888e5e..bd87a447cd 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -331,11 +331,7 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa
if (!u) {
delete = true;
- u = unit_new(m, sizeof(Device));
- if (!u)
- return log_oom();
-
- r = unit_add_name(u, e);
+ r = unit_new_for_name(m, sizeof(Device), e, &u);
if (r < 0)
goto fail;