aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2009-06-04 16:01:23 +0000
committerAndrew Dunstan <andrew@dunslane.net>2009-06-04 16:01:23 +0000
commitd68475eb96845f7438ca09ff5231e65696bafcb0 (patch)
tree7055ef2222a5a03926b28758a3f740faf27abced
parentf16cd6ec38851feeb4982b2588388ff975e28fcf (diff)
downloadpostgresql-d68475eb96845f7438ca09ff5231e65696bafcb0.tar.gz
postgresql-d68475eb96845f7438ca09ff5231e65696bafcb0.zip
Initialise perl library as documented in perl API. Backpatch to release 7.4.
-rw-r--r--src/pl/plperl/plperl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 3aa551cdbe0..3a34e648815 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.40.2.1 2005/01/26 17:09:21 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.40.2.2 2009/06/04 16:01:23 adunstan Exp $
*
**********************************************************************/
@@ -214,12 +214,18 @@ plperl_init_interp(void)
"sub ::mkunsafefunc {return eval(qq[ sub { $_[0] } ]); }"
};
+ int nargs = 3;
+
+#ifdef PERL_SYS_INIT3
+ PERL_SYS_INIT3(&nargs, (char ***) &embedding, NULL);
+#endif
+
plperl_interp = perl_alloc();
if (!plperl_interp)
elog(ERROR, "could not allocate perl interpreter");
perl_construct(plperl_interp);
- perl_parse(plperl_interp, plperl_init_shared_libs, 3, embedding, NULL);
+ perl_parse(plperl_interp, plperl_init_shared_libs, nargs, embedding, NULL);
perl_run(plperl_interp);
/************************************************************