summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2003-09-18 04:02:02 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-18 19:23:22 +0000
commita80d47c2f481402c370d7113267069d0c75ceeeb (patch)
tree5aab7d4f538adc19ec5563cf70b08e125c7b7688
parent29ddfe354327d85ef66e9723b006d41eb553cd25 (diff)
downloadperl-a80d47c2f481402c370d7113267069d0c75ceeeb.tar.gz
-M -A -C broken
Message-ID: <20030918180202.GA21949@math.berkeley.edu> (use stat.t instead of time.t) p4raw-id: //depot/perl@21277
-rw-r--r--os2/os2ish.h5
-rw-r--r--pp_sys.c6
-rwxr-xr-xt/op/stat.t17
3 files changed, 24 insertions, 4 deletions
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 7825c93148..3ff25f2366 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -14,6 +14,11 @@
*/
#define HAS_UTIME /**/
+/* BIG_TIME:
+ * This symbol is defined if Time_t is an unsigned type on this system.
+ */
+#define BIG_TIME
+
#define HAS_KILL
#define HAS_WAIT
#define HAS_DLERROR
diff --git a/pp_sys.c b/pp_sys.c
index 0a3c95e159..8c9c3cce48 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3084,7 +3084,7 @@ PP(pp_ftmtime)
dSP; dTARGET;
if (result < 0)
RETPUSHUNDEF;
- PUSHn( (PL_basetime - PL_statcache.st_mtime) / 86400.0 );
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_mtime)) / 86400.0 );
RETURN;
}
@@ -3094,7 +3094,7 @@ PP(pp_ftatime)
dSP; dTARGET;
if (result < 0)
RETPUSHUNDEF;
- PUSHn( (PL_basetime - PL_statcache.st_atime) / 86400.0 );
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_atime)) / 86400.0 );
RETURN;
}
@@ -3104,7 +3104,7 @@ PP(pp_ftctime)
dSP; dTARGET;
if (result < 0)
RETPUSHUNDEF;
- PUSHn( (PL_basetime - PL_statcache.st_ctime) / 86400.0 );
+ PUSHn( (((NV)PL_basetime - PL_statcache.st_ctime)) / 86400.0 );
RETURN;
}
diff --git a/t/op/stat.t b/t/op/stat.t
index 69caf8c68a..b863f98c80 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -9,7 +9,7 @@ BEGIN {
use Config;
use File::Spec;
-plan tests => 73;
+plan tests => 78;
my $Perl = which_perl();
@@ -427,6 +427,21 @@ SKIP: {
unlink $linkname or print "# unlink $linkname failed: $!\n";
}
+print "# Zzz...\n";
+sleep(3);
+my $f = 'tstamp.tmp';
+unlink $f;
+ok (open(S, "> $f"), 'can create tmp file');
+close S or die;
+my @a = stat $f;
+print "# time=$^T, stat=(@a)\n";
+my @b = (-M _, -A _, -C _);
+print "# -MAC=(@b)\n";
+ok( (-M _) < 0, 'negative -M works');
+ok( (-A _) < 0, 'negative -A works');
+ok( (-C _) < 0, 'negative -C works');
+ok(unlink($f), 'unlink tmp file');
+
END {
1 while unlink $tmpfile;
}