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

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