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

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