X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fdevice.c;h=5307341d7056ddd7bfc3387d10b512e8ed7b476a;hp=cd0a09954620b0396f11c59d3172ca09d0001783;hb=96342de68d0d6de71a062d984dafd2a0905ed9fe;hpb=c69182961b00707d977957cf81d5c41cfbeab429 diff --git a/src/core/device.c b/src/core/device.c index cd0a09954..5307341d7 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -144,7 +144,8 @@ static int device_add_escaped_name(Unit *u, const char *dn) { assert(dn); assert(dn[0] == '/'); - if (!(e = unit_name_from_path(dn, ".device"))) + e = unit_name_from_path(dn, ".device"); + if (!e) return -ENOMEM; r = unit_add_name(u, e); @@ -165,7 +166,8 @@ static int device_find_escape_name(Manager *m, const char *dn, Unit **_u) { assert(dn[0] == '/'); assert(_u); - if (!(e = unit_name_from_path(dn, ".device"))) + e = unit_name_from_path(dn, ".device"); + if (!e) return -ENOMEM; u = manager_get_unit(m, e); @@ -585,7 +587,6 @@ static const char* const device_state_table[_DEVICE_STATE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(device_state, DeviceState); const UnitVTable device_vtable = { - .suffix = ".device", .object_size = sizeof(Device), .sections = "Unit\0"