summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-26 04:18:44 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-26 04:18:44 +0100
commit034c6ed7da5e44bfdde5a5d0da75f7b7a59953b8 (patch)
treeea59315075d3ebda2de695b1bd0621d79fa9e987 /device.c
parent9152c765065184d0c1267ed2499e3fe4cac53755 (diff)
first attempt at proper service/socket logic
Diffstat (limited to 'device.c')
-rw-r--r--device.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/device.c b/device.c
index 79847c46b7..ec0a40a4df 100644
--- a/device.c
+++ b/device.c
@@ -4,6 +4,13 @@
#include "device.h"
#include "strv.h"
+static void device_done(Name *n) {
+ Device *d = DEVICE(n);
+
+ assert(d);
+ strv_free(d->sysfs);
+}
+
static void device_dump(Name *n, FILE *f, const char *prefix) {
static const char* const state_table[_DEVICE_STATE_MAX] = {
@@ -24,24 +31,12 @@ static NameActiveState device_active_state(Name *n) {
return DEVICE(n)->state == DEVICE_DEAD ? NAME_INACTIVE : NAME_ACTIVE;
}
-static void device_free_hook(Name *n) {
- Device *d = DEVICE(n);
-
- assert(d);
- strv_free(d->sysfs);
-}
-
const NameVTable device_vtable = {
.suffix = ".device",
- .load = name_load_fragment_and_dropin,
+ .init = name_load_fragment_and_dropin,
+ .done = device_done,
.dump = device_dump,
- .start = NULL,
- .stop = NULL,
- .reload = NULL,
-
- .active_state = device_active_state,
-
- .free_hook = device_free_hook
+ .active_state = device_active_state
};