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

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