0,0 → 1,64 |
#! /bin/sh |
## 12_perl_init.dpatch by Magnus Holmgren <holmgren@debian.org> |
## |
## DP: Properly call PERL_SYS_INIT() and PERL_SYS_TERM(). |
## DP: Credit to Niko Tyni <ntyni@debian.org>. |
|
FILE=src/modules/Perl/configure |
|
dpatch_patch() { |
[ ! -e ${FILE}.bak ] || return 1 |
|
sed -i.bak -f - ${FILE} <<'END_SED' |
/my_perl = perl_alloc();/i\ |
PERL_SYS_INIT3(&argc,&argv,&env); |
/perl_free(my_perl);/a\ |
PERL_SYS_TERM(); |
END_SED |
|
patch -p1 $* |
|
} |
|
dpatch_unpatch() { |
patch -p1 -R $* && [ -e ${FILE}.bak ] && mv -f ${FILE}.bak ${FILE} |
|
} |
|
|
DPATCH_LIB_NO_DEFAULT=1 |
|
. /usr/share/dpatch/dpatch.lib.sh |
|
exit |
|
@DPATCH@ |
--- 7.6-stable~/src/modules/Perl/perlmod.c 2004-04-15 02:11:26.000000000 +0200 |
+++ 7.6-stable/src/modules/Perl/perlmod.c 2008-06-16 22:50:54.000000000 +0200 |
@@ -235,6 +235,7 @@ |
} |
|
static char *dummyargv[] = { "perl", "-e", "1", 0 }; |
+static int dummyargc = 3; |
|
static void init_perl_glue(struct object *o) |
{ |
@@ -263,6 +264,9 @@ |
return; |
} |
#endif |
+ if (num_perl_interpreters == 0) |
+ PERL_SYS_INIT(&dummyargc, &dummyargv); |
+ |
MT_PERMIT; |
ps->perl = perl_alloc(); |
PL_perl_destruct_level=2; |
@@ -334,6 +338,8 @@ |
perl_free(ps->perl); |
MT_FORBID; |
num_perl_interpreters--; |
+ if (num_perl_interpreters == 0) |
+ PERL_SYS_TERM(); |
} |
_free_arg_and_env(); |
} |
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Index: 00list |
=================================================================== |
--- 00list (revision 32) |
+++ 00list (revision 33) |
@@ -5,3 +5,4 @@ |
07_dynamic_module_makefile.in-libgcc |
10_misplaced_MAXPATHLEN |
11_pthread_stub |
+12_perl_init |