X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=device.c;h=b8bab4b02d9b92aa993d40762a9dee2d04174c44;hb=fb33a393e21a15ce3b4ac8c16d947fd9b6e77206;hp=ec0a40a4df6561c333226057b5702662e5640a3d;hpb=034c6ed7da5e44bfdde5a5d0da75f7b7a59953b8;p=elogind.git diff --git a/device.c b/device.c index ec0a40a4d..b8bab4b02 100644 --- a/device.c +++ b/device.c @@ -1,24 +1,24 @@ /*-*- Mode: C; c-basic-offset: 8 -*-*/ -#include "name.h" +#include "unit.h" #include "device.h" #include "strv.h" -static void device_done(Name *n) { - Device *d = DEVICE(n); +static void device_done(Unit *u) { + Device *d = DEVICE(u); assert(d); strv_free(d->sysfs); } -static void device_dump(Name *n, FILE *f, const char *prefix) { +static void device_dump(Unit *u, FILE *f, const char *prefix) { static const char* const state_table[_DEVICE_STATE_MAX] = { [DEVICE_DEAD] = "dead", [DEVICE_AVAILABLE] = "available" }; - Device *s = DEVICE(n); + Device *s = DEVICE(u); assert(s); @@ -27,14 +27,14 @@ static void device_dump(Name *n, FILE *f, const char *prefix) { prefix, state_table[s->state]); } -static NameActiveState device_active_state(Name *n) { - return DEVICE(n)->state == DEVICE_DEAD ? NAME_INACTIVE : NAME_ACTIVE; +static UnitActiveState device_active_state(Unit *u) { + return DEVICE(u)->state == DEVICE_DEAD ? UNIT_INACTIVE : UNIT_ACTIVE; } -const NameVTable device_vtable = { +const UnitVTable device_vtable = { .suffix = ".device", - .init = name_load_fragment_and_dropin, + .init = unit_load_fragment_and_dropin, .done = device_done, .dump = device_dump,