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.
I haven't checked if the same problem occurs with mod_perl 1.

--- 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);
End.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to