This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Y2031 problem in tst-fseek.c ...
- From: Dan Kegel <dank at kegel dot com>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Thu, 24 Jul 2003 21:03:00 -0700
- Subject: Y2031 problem in tst-fseek.c ...
OK, not that this is pressing or anything, but
IIRC in the year 2031, time() will go negative,
and for the next bunch of years, the sequence
t0 = time(0);
sleep(1);
t1 = time(0);
assert(t1 > t0);
will fail.
That being the case, maybe we should avoid those t1 > t0 style
comparisons now? A trivial fix might be:
--- glibc-2.2.5/stdio-common/tst-fseek.c.old Thu Jul 24 20:36:32 2003
+++ glibc-2.2.5/stdio-common/tst-fseek.c Thu Jul 24 20:37:08 2003
@@ -346,22 +346,22 @@
puts ("fstat64() after fseeko() failed\n");
result = 1;
}
- if (st1.st_ctime >= t)
+ if (st1.st_ctime == t)
{
puts ("st_ctime not updated");
result = 1;
}
- if (st1.st_mtime >= t)
+ if (st1.st_mtime == t)
{
puts ("st_mtime not updated");
result = 1;
}
- if (st1.st_ctime >= st2.st_ctime)
+ if (st1.st_ctime == st2.st_ctime)
{
puts ("st_ctime not changed");
result = 1;
}
- if (st1.st_mtime >= st2.st_mtime)
+ if (st1.st_mtime == st2.st_mtime)
{
puts ("st_mtime not changed");
result = 1;
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045