diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-26 04:18:44 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-26 04:18:44 +0100 |
commit | 034c6ed7da5e44bfdde5a5d0da75f7b7a59953b8 (patch) | |
tree | ea59315075d3ebda2de695b1bd0621d79fa9e987 /automount.c | |
parent | 9152c765065184d0c1267ed2499e3fe4cac53755 (diff) |
first attempt at proper service/socket logic
Diffstat (limited to 'automount.c')
-rw-r--r-- | automount.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/automount.c b/automount.c index 84691e6e6e..b64bacbf4a 100644 --- a/automount.c +++ b/automount.c @@ -8,13 +8,13 @@ #include "load-fstab.h" #include "load-dropin.h" -static int automount_load(Name *n) { +static int automount_init(Name *n) { int r; Automount *a = AUTOMOUNT(n); assert(a); - exec_context_defaults(&a->exec_context); + exec_context_init(&a->exec_context); /* Load a .automount file */ if ((r = name_load_fragment(n)) < 0 && errno != -ENOENT) @@ -31,6 +31,13 @@ static int automount_load(Name *n) { return 0; } +static void automount_done(Name *n) { + Automount *d = AUTOMOUNT(n); + + assert(d); + free(d->path); +} + static void automount_dump(Name *n, FILE *f, const char *prefix) { static const char* const state_table[_AUTOMOUNT_STATE_MAX] = { @@ -67,7 +74,7 @@ static void automount_dump(Name *n, FILE *f, const char *prefix) { for (c = 0; c < _AUTOMOUNT_EXEC_MAX; c++) { ExecCommand *i; - LIST_FOREACH(i, s->exec_command[c]) + LIST_FOREACH(command, i, s->exec_command[c]) fprintf(f, "%s%s: %s\n", prefix, command_table[c], i->path); } } @@ -88,24 +95,13 @@ static NameActiveState automount_active_state(Name *n) { return table[AUTOMOUNT(n)->state]; } -static void automount_free_hook(Name *n) { - Automount *d = AUTOMOUNT(n); - - assert(d); - free(d->path); -} - const NameVTable automount_vtable = { .suffix = ".mount", - .load = automount_load, - .dump = automount_dump, - - .start = NULL, - .stop = NULL, - .reload = NULL, + .init = automount_init, + .done = automount_done, - .active_state = automount_active_state, + .dump = automount_dump, - .free_hook = automount_free_hook + .active_state = automount_active_state }; |