From: Andrew Dunstan <andrew@dunslane.net> Date: Thu, 4 Jun 2009 16:01:23 +0000 (+0000) Subject: Initialise perl library as documented in perl API. Backpatch to release 7.4. X-Git-Tag: REL7_4_26~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d68475eb96845f7438ca09ff5231e65696bafcb0;p=postgresql Initialise perl library as documented in perl API. Backpatch to release 7.4. --- diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 3aa551cdbe..3a34e64881 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); /************************************************************