summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan2009-06-04 15:59:55 +0000
committerAndrew Dunstan2009-06-04 15:59:55 +0000
commit09fdf4b7da3ed97d099c4c62e88657cd14f50a51 (patch)
treeb79840239a0fe8865489fb7b7b573d2534213524
parentf3c0babf13e54574bc23b77b2ee5bfd0fee07e7e (diff)
Initialise perl library as documented in perl API. Backpatch to release 7.4.
-rw-r--r--src/pl/plperl/plperl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 2127a2369f..9aa92bb3be 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -399,6 +399,8 @@ plperl_init_interp(void)
"", "-e", PERLBOOT
};
+ int nargs = 3;
+
#ifdef WIN32
/*
@@ -442,13 +444,19 @@ plperl_init_interp(void)
#endif
+#ifdef PERL_SYS_INIT3
+ /* only call this the first time through, as per perlembed man page */
+ if (interp_state == INTERP_NONE)
+ PERL_SYS_INIT3(&nargs, (char ***) &embedding, NULL);
+#endif
+
plperl_held_interp = perl_alloc();
if (!plperl_held_interp)
elog(ERROR, "could not allocate Perl interpreter");
perl_construct(plperl_held_interp);
perl_parse(plperl_held_interp, plperl_init_shared_libs,
- 3, embedding, NULL);
+ nargs, embedding, NULL);
perl_run(plperl_held_interp);
if (interp_state == INTERP_NONE)