Rafael Garcia-Suarez wrote:
I don't think this happens on mod_perl 2 with prefork MPM, but I'm not sure why. Could someone try with mod_perl 2 / threaded or prefork MPM to see if the problem on $$ exists ? (Sorry, lacking time to test this myself now) I see that mod_perl 2 has a function modperl_perl_init_ids() in modperl_perl.c. That would probably a good place to reinit PL_ppid as well.
And indeed this (tested) patch against mod_perl 1.99_10 fixes it.
Thanks Rafael. In the future please post patches against the current cvs if possible, as I've already applied a similar fix, though yours is definitely better. The cvs version already includes a test for this bug.
Though in your patch should we check for:
#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 1
and higher and otherwise do nothing? Or do you think that checking for THREADS_HAVE_PIDS is enough? won't it be set as well in 5.6.x built with threads?
--- src/modules/perl/modperl_perl.c.orig Fri Oct 17 22:33:58 2003
+++ src/modules/perl/modperl_perl.c Sat Oct 18 00:53:46 2003
@@ -33,6 +33,9 @@ void modperl_perl_core_global_init(pTHX)
static void modperl_perl_ids_get(modperl_perl_ids_t *ids)
{
ids->pid = (I32)getpid();
+#ifdef THREADS_HAVE_PIDS
+ ids->ppid = (I32)getppid();
+#endif
#ifndef WIN32
ids->uid = getuid();
ids->euid = geteuid(); @@ -55,6 +58,9 @@ static void modperl_perl_init_ids(pTHX_ PL_euid = ids->euid;
PL_gid = ids->gid;
PL_egid = ids->egid;
+#endif
+#ifdef THREADS_HAVE_PIDS
+ PL_ppid = ids->ppid;
#endif
}
--- src/modules/perl/modperl_perl.h.orig Fri Oct 17 22:35:57 2003
+++ src/modules/perl/modperl_perl.h Sat Oct 18 00:53:57 2003
@@ -5,6 +5,9 @@
I32 pid;
Uid_t uid, euid;
Gid_t gid, egid;
+#ifdef THREADS_HAVE_PIDS
+ Uid_t ppid;
+#endif
} modperl_perl_ids_t;
void modperl_perl_core_global_init(pTHX);
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
