X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fdevice.c;h=5307341d7056ddd7bfc3387d10b512e8ed7b476a;hp=88ce0cdd18719174de07cbe502152cdb7ae87421;hb=b3ac5f8cb98757416d8660023d6564a7c411f0a0;hpb=5430f7f2bc7330f3088b894166bf3524a067e3d8 diff --git a/src/core/device.c b/src/core/device.c index 88ce0cdd1..5307341d7 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -30,6 +30,7 @@ #include "unit-name.h" #include "dbus-device.h" #include "def.h" +#include "path-util.h" static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = { [DEVICE_DEAD] = UNIT_INACTIVE, @@ -143,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); @@ -164,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); @@ -584,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" @@ -612,5 +614,15 @@ const UnitVTable device_vtable = { .following_set = device_following_set, .enumerate = device_enumerate, - .shutdown = device_shutdown + .shutdown = device_shutdown, + + .status_message_formats = { + .starting_stopping = { + [0] = "Expecting device %s...", + }, + .finished_start_job = { + [JOB_DONE] = "Found device %s.", + [JOB_TIMEOUT] = "Timed out waiting for device %s.", + }, + }, };