Blame SOURCES/autofs-5.1.1-implement-reinit-in-hosts-lookup-module.patch

306fa1
autofs-5.1.1 - implement reinit in hosts lookup module
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Refactor the hosts lookup module to add an implementation for the newly
306fa1
added reinit entry point.
306fa1
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 modules/lookup_hosts.c |   10 ++++++++++
306fa1
 1 file changed, 10 insertions(+)
306fa1
306fa1
diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
306fa1
index 8ba0a4a..0a64655 100644
306fa1
--- a/modules/lookup_hosts.c
306fa1
+++ b/modules/lookup_hosts.c
306fa1
@@ -69,6 +69,7 @@ int lookup_init(const char *mapfmt,
306fa1
 		free(ctxt);
306fa1
 		return 1;
306fa1
 	}
306fa1
+
306fa1
 	*context = ctxt;
306fa1
 
306fa1
 	return 0;
306fa1
@@ -77,6 +78,15 @@ int lookup_init(const char *mapfmt,
306fa1
 int lookup_reinit(const char *mapfmt,
306fa1
 		  int argc, const char *const *argv, void **context)
306fa1
 {
306fa1
+	struct lookup_context *ctxt = (struct lookup_context *) *context;
306fa1
+	int ret;
306fa1
+
306fa1
+	mapfmt = MAPFMT_DEFAULT;
306fa1
+
306fa1
+	ret = reinit_parse(ctxt->parse, mapfmt, MODPREFIX, argc, argv);
306fa1
+	if (ret)
306fa1
+		return 1;
306fa1
+
306fa1
 	return 0;
306fa1
 }
306fa1