You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philippe M. Chiasson" <go...@ectoplasm.org> on 2005/09/23 21:32:08 UTC
Re: [patch mp2] Fixes to $0 handling [Was: Directive changes
the command name]
Philip M. Gollucci wrote:
> Philippe M. Chiasson wrote:
>
>> I've finally had time to dig deeper in the troubling $0 and process
>> display
>> problems that seem to exist at least on *BSDs and HP-UX.
>>
>> [...]
>>
>> The correct solution (see patch) is:
>>
>> - Reset $0 to the _real_ argv[0] after calling perl_parse()
>> /* Also need to fix PL_origalen */
>> PL_origalen = strlen(argv[0])+1;
>> /* argv[0] = '/usr/bin/httpd' */
>> sv_setpv_mg(get_sv("0",0), argv[0]);
>>
>> - Use the real argv[0] (s->process->argv) and not a copy
>
> Dear God!
>
> +1
>
> The test suite passes 100% with this applied and manual inspection of ps
> looks good.
Great, checked in as change r291193
> That on FreeBSD... hopefully I'll have some Open/Net BSD in the near
> future too.
--
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5