1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
7 static void device_done(Unit *u) {
14 static void device_dump(Unit *u, FILE *f, const char *prefix) {
16 static const char* const state_table[_DEVICE_STATE_MAX] = {
17 [DEVICE_DEAD] = "dead",
18 [DEVICE_AVAILABLE] = "available"
21 Device *s = DEVICE(u);
26 "%sDevice State: %s\n",
27 prefix, state_table[s->state]);
30 static UnitActiveState device_active_state(Unit *u) {
31 return DEVICE(u)->state == DEVICE_DEAD ? UNIT_INACTIVE : UNIT_ACTIVE;
34 const UnitVTable device_vtable = {
37 .init = unit_load_fragment_and_dropin,
41 .active_state = device_active_state