summaryrefslogtreecommitdiffstats
path: root/lib/param/loadparm.c
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-20 10:58:15 +1300
committerJeremy Allison <jra@samba.org>2014-05-07 19:49:15 +0200
commita62b655558b62d7cb6c6522dba68e8e88e2ef9ca (patch)
treede38a3395d1cb4e3687a1cd69d248fd8d488357c /lib/param/loadparm.c
parent7be7a81821760b3aa853d4b349bad8570180c3c5 (diff)
downloadsamba-a62b655558b62d7cb6c6522dba68e8e88e2ef9ca.tar.gz
samba-a62b655558b62d7cb6c6522dba68e8e88e2ef9ca.tar.xz
samba-a62b655558b62d7cb6c6522dba68e8e88e2ef9ca.zip
lib/param: change add_to_file_list to not use a loadparm context
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/param/loadparm.c')
-rw-r--r--lib/param/loadparm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index aaf905d8f46..ef46a54b153 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1006,10 +1006,10 @@ static bool lpcfg_service_ok(struct loadparm_service *service)
it's date and needs to be reloaded.
********************************************************************/
-static void add_to_file_list(struct loadparm_context *lp_ctx,
+static void add_to_file_list(TALLOC_CTX *mem_ctx, struct file_lists **file,
const char *fname, const char *subfname)
{
- struct file_lists *f = lp_ctx->file_lists;
+ struct file_lists *f = *file;
while (f) {
if (f->name && !strcmp(f->name, fname))
@@ -1018,10 +1018,10 @@ static void add_to_file_list(struct loadparm_context *lp_ctx,
}
if (!f) {
- f = talloc(lp_ctx, struct file_lists);
+ f = talloc(mem_ctx, struct file_lists);
if (!f)
return;
- f->next = lp_ctx->file_lists;
+ f->next = *file;
f->name = talloc_strdup(f, fname);
if (!f->name) {
talloc_free(f);
@@ -1032,7 +1032,7 @@ static void add_to_file_list(struct loadparm_context *lp_ctx,
talloc_free(f);
return;
}
- lp_ctx->file_lists = f;
+ *file = f;
f->modtime = file_modtime(subfname);
} else {
time_t t = file_modtime(subfname);
@@ -1115,7 +1115,7 @@ static bool handle_include(struct loadparm_context *lp_ctx, int unused,
{
char *fname = standard_sub_basic(lp_ctx, pszParmValue);
- add_to_file_list(lp_ctx, pszParmValue, fname);
+ add_to_file_list(lp_ctx, &lp_ctx->file_lists, pszParmValue, fname);
lpcfg_string_set(lp_ctx, ptr, fname);
@@ -2539,7 +2539,7 @@ bool lpcfg_load(struct loadparm_context *lp_ctx, const char *filename)
n2 = standard_sub_basic(lp_ctx, lp_ctx->szConfigFile);
DEBUG(2, ("lpcfg_load: refreshing parameters from %s\n", n2));
- add_to_file_list(lp_ctx, lp_ctx->szConfigFile, n2);
+ add_to_file_list(lp_ctx, &lp_ctx->file_lists, lp_ctx->szConfigFile, n2);
/* We get sections first, so have to start 'behind' to make up */
lp_ctx->currentService = NULL;