On Jan 27, 2009, at 8:43 AM, John Malmberg wrote:
VMS stat fixes:
1. Allow null thread context.
2. First use VMS syntax for files and directories then fall back to
Unix syntax with EFS enabled.
3. When Unix syntax with EFS is used, EFS must also be used to store
the resultant filename.
4. fid_to_name() needs to use the same algorithm as stat() for
consistency.
5. fid_to_name() followed by a flex_stat/flex_lstat call to see if
this is a directory is a waste of cycles.
This applied with a number of offsets and produced the following
compiler warnings. There must be something missing in the patch as
submitted.
ret_spec = int_tovmspath(fspec, temp_fspec, NULL);
...............^
%CC-I-IMPLICITFUNC, In this statement, the identifier "int_tovmspath"
is implicitly declared as a function.
at line number 12751 in file D0:[craig.perl]vms.c;2
ret_spec = int_tovmspath(fspec, temp_fspec, NULL);
....^
%CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
"int", is being converted to "pointer to char".
at line number 12751 in file D0:[craig.perl]vms.c;2
ret_spec = int_tovmspath(name, temp_fspec, NULL);
....^
%CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
"int", is being converted to "pointer to char".
at line number 14120 in file D0:[craig.perl]vms.c;2
ret_spec = int_tovmspath(name, temp_fspec, NULL);
........^
%CC-W-CVTDIFTYPES, In this statement, "int_tovmspath(...)" of type
"int", is being converted to "pointer to char".
at line number 14158 in file D0:[craig.perl]vms.c;2
I'm also concerned about the proliferation of similar but different
function names. We already have a flex_stat_int, where presumably the
"int" is short for "internal." So do we really want an int_flex_stat
as well? Which one is more internal?
+#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.
________________________________________
Craig A. Berry
mailto:craigbe...@mac.com
"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser