34,8 → 34,8 |
+ if (!(handle = dlopen(filename, RTLD_NOW)) |
+ || !(tmi->template_map = dlsym(handle, map_symbol)) |
+ || !(tmi->count = dlsym(handle, count_symbol))) { |
+ log_fatal("Failed to load template library: \"%s\": %s", |
+ filename, dlerror()); |
+ log_fatal("Failed to load template library: %s", |
+ dlerror()); |
+ } |
+ log_debug("Loaded library %s with %d templates", filename, *tmi->count); |
+ free(filename); |
126,15 → 126,15 |
|
--- a/servers/prayer_chroot.c |
+++ b/servers/prayer_chroot.c |
@@ -327,6 +327,8 @@ int main(int argc, char *argv[]) |
config_extract_ssl(config, &ssl_config); |
iostream_init(&ssl_config); |
@@ -255,6 +255,8 @@ int main(int argc, char *argv[]) |
if (list_length(prayer->http_port_list) == 0L) |
prayer_fatal(prayer, "No HTTP or HTTPS ports active"); |
|
+ dlopen_templates(config->template_set, "_frontend"); |
+ |
prayer_main_write_pid(config); |
if (config->prayer_background && !want_foreground) { |
pid_t pid = fork(); |
|
if (want_prefork && !want_foreground) |
--- a/shared/Makefile |
+++ b/shared/Makefile |
@@ -33,7 +33,7 @@ MYCFLAGS = $(BASECFLAGS) |
148,15 → 148,15 |
all: $(SHARED_OBJS) |
--- a/servers/prayer_main.c |
+++ b/servers/prayer_main.c |
@@ -350,6 +350,8 @@ int main(int argc, char *argv[]) |
open("/dev/null", O_WRONLY); /* Reopen stderr */ |
} |
@@ -290,6 +290,8 @@ int main(int argc, char *argv[]) |
|
prayer_log_open(prayer); |
|
+ dlopen_templates(config->template_set, "_frontend"); |
+ |
prayer_main_write_pid(config); |
if (config->limit_vm) |
os_limit_vm(config->limit_vm); |
|
if (want_prefork && !want_foreground) |
--- a/shared/shared.h |
+++ b/shared/shared.h |
@@ -40,3 +40,4 @@ extern int errno; /* just |