X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=automount.c;fp=automount.c;h=b64bacbf4a398339eea1946c5c9a2623e97f74bc;hb=034c6ed7da5e44bfdde5a5d0da75f7b7a59953b8;hp=84691e6e6eb875899c037a157bc5dc3964a5b2e4;hpb=9152c765065184d0c1267ed2499e3fe4cac53755;p=elogind.git diff --git a/automount.c b/automount.c index 84691e6e6..b64bacbf4 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 };