From d68475eb96845f7438ca09ff5231e65696bafcb0 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Thu, 4 Jun 2009 16:01:23 +0000 Subject: [PATCH] Initialise perl library as documented in perl API. Backpatch to release 7.4. --- src/pl/plperl/plperl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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); /************************************************************ -- 2.40.0