This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]