develooper Front page | perl.perl5.porters | Postings from January 2009

Re: [blead-442-gc6d234b] VMS stat fixes.

Thread Previous | Thread Next
From:
John Malmberg
Date:
January 28, 2009 21:08
Subject:
Re: [blead-442-gc6d234b] VMS stat fixes.
Message ID:
498139BC.5090402@gmail.com
Craig A. Berry wrote:

> On Jan 27, 2009, at 8:43 AM, John Malmberg wrote:

It turns out that with a simple optimization, the int_flex_stat() and 
int_flex_lstat() will not be used.

This is also a side effect of dealing with that the CRTL sees "foo bar" 
and "foobar" as the same file in the default mode, and Perl sees them as 
different files.

>> +#if defined(PERL_IMPLICIT_CONTEXT)
>> +        /* If the context is null, this will access violate */
>> +        /* and stat() has so many issues we will may need to use this */
>> +        /* routine in places where we do not have a thread context */
>> +        /* In those cases we usually do not care about the time 
>> stamps */
>> +        if (aTHX != NULL) {
>> +#endif
>> +        time((time_t *)&statbufp->st_mtime);
>> +#if defined(PERL_IMPLICIT_CONTEXT)
>> +        } else {
>> +            statbufp->st_mtime = 0;
>> +        }
>> +#endif
>>
> 
> A better way to fix this is in Perl_my_time with something like:
> 
> --- vms/vms.c;-0        2009-01-28 18:32:55 -0600
> +++ vms/vms.c   2009-01-28 18:58:30 -0600
> @@ -11995,9 +11995,17 @@ time_t Perl_my_time(pTHX_ time_t *timep)
>    when = time(NULL);
>  # ifdef VMSISH_TIME
>  # ifdef RTL_USES_UTC
> -  if (VMSISH_TIME) when = _toloc(when);
> +  if (
> +#  if defined(PERL_IMPLICIT_CONTEXT)
> +      my_perl &&
> +#  endif
> +      VMSISH_TIME) when = _toloc(when);
>  # else
> -  if (!VMSISH_TIME) when = _toutc(when);
> +  if (
> +#  if defined(PERL_IMPLICIT_CONTEXT)
> +      my_perl &&
> +#  endif
> +      !VMSISH_TIME) when = _toutc(when);
>  # endif
>  # endif
>    if (timep != NULL) *timep = when;
> 
> The place where it's checking Perl context is when it's looking at the 
> vmsish bits of $^H.

I can do that.  I did not see any other places where the time wrapper is 
called with a null thread context, so it seems simpler to just avoid 
calling it when simulating stat() for NLAO:

-John
wb8tyw@gmail.com
Personal Opinion Only

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About