diff options
author | Dan Sugalski <sugalsd@lbcc.cc.or.us> | 1997-09-05 00:00:00 +0000 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-09-05 00:00:00 +0000 |
commit | 7b62b82bd65e5c25c8b1cad9ebeb185d3b61c873 (patch) | |
tree | 53ebf3efcaf09810a6ac313d0cfdd978feb54a8e /vms/vms.c | |
parent | 34d7b60e8af9fdce62d2ce3ffce87de14177f86e (diff) | |
download | perl-7b62b82bd65e5c25c8b1cad9ebeb185d3b61c873.tar.gz |
lib/timelocal.t fails test 1 for VMS 7.1
The VMS Perl port has local routines to handle time(), localtime(), and
gmtime(), because the implementations of these on VMS are broken for VMS
v6.2 and below. This implemetation gets strange for most of Jan 1, 1970
(From midnight to 4 PM), and behaves oddly for daylight savings time, but
only on OpenVMS 7.0 and 7.1.
The following patch disables the local versions of time(), localtime(), and
gmtime(), and uses the system provided versions, for OpenVMS 7.0 and up.
5.004_03 passes all tests with this patch. Tested on OpenVMS Alpha 7.1 and
6.2, and OpenVMS Vax 7.1, 6.2, and 5.5-2.
p5p-msgid: 3.0.3.32.19970908112449.0087bc90@stargate.lbcc.cc.or.us
Diffstat (limited to 'vms/vms.c')
-rw-r--r-- | vms/vms.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -3177,7 +3177,7 @@ void my_endpwent() } /*}}}*/ - +#if __VMS_VER < 70000000 || __DECC_VER < 50200000 /* Used for UTC calculation in my_gmtime(), my_localtime(), my_time(), * my_utime(), and flex_stat(), all of which operate on UTC unless * VMSISH_TIMES is true. @@ -3303,6 +3303,7 @@ my_localtime(const time_t *timep) #define localtime(t) my_localtime(t) #define time(t) my_time(t) +#endif /* VMS VER < 7.0 || Dec C < 5.2 /* my_utime - update modification time of a file * calling sequence is identical to POSIX utime(), but under @@ -3366,7 +3367,7 @@ int my_utime(char *file, struct utimbuf *utimes) */ lowbit = (utimes->modtime & 1) ? secscale : 0; unixtime = (long int) utimes->modtime; -# ifdef VMSISH_TIME +#if defined(VMSISH_TIME) && (__VMS_VER < 70000000 || __DECC_VER < 50200000) if (!VMSISH_TIME) { /* Input was UTC; convert to local for sys svc */ if (!gmtime_emulation_type) (void) time(NULL); /* Initialize UTC */ unixtime += utc_offset_secs; @@ -3716,10 +3717,12 @@ flex_fstat(int fd, struct mystat *statbufp) # else if (1) { # endif +#if __VMS_VER < 70000000 || __DECC_VER < 50200000 if (!gmtime_emulation_type) (void)time(NULL); statbufp->st_mtime -= utc_offset_secs; statbufp->st_atime -= utc_offset_secs; statbufp->st_ctime -= utc_offset_secs; +#endif } return 0; } @@ -3769,10 +3772,12 @@ flex_stat(char *fspec, struct mystat *statbufp) # else if (1) { # endif +#if __VMS_VER < 70000000 || __DECC_VER < 50200000 if (!gmtime_emulation_type) (void)time(NULL); statbufp->st_mtime -= utc_offset_secs; statbufp->st_atime -= utc_offset_secs; statbufp->st_ctime -= utc_offset_secs; +#endif } } return retval; |