Subject: bin/4139: year-2038 problem in make
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dholland@eecs.harvard.edu>
List: netbsd-bugs
Date: 09/22/1997 19:11:43
>Number:         4139
>Category:       bin
>Synopsis:       year-2038 problem in make
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 22 23:35:01 1997
>Last-Modified:
>Originator:     David A. Holland <dholland@eecs.harvard.edu>
>Organization:
   - David A. Holland             |    VINO project home page:
     dholland@eecs.harvard.edu    | http://www.eecs.harvard.edu/vino
>Release:        1.2
>Environment:
	
System: NetBSD chianti.eecs.harvard.edu 1.2.1 NetBSD 1.2.1 (CHIANTI) #1: Tue Sep 9 16:52:39 EDT 1997 root@chianti.eecs.harvard.edu:/usr/src/sys/arch/i386/compile/CHIANTI i386

I actually found this in -current of 19970410.

>Description:
	A couple of places in make use int instead of time_t, leading
	to eventual problems.
>How-To-Repeat:
>Fix:

Index: arch.c
===================================================================
RCS file: /home/vino/repo/src/tools/make/arch.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 arch.c
--- arch.c	1997/04/14 21:01:17	1.1.1.2
+++ arch.c	1997/09/11 19:20:07
@@ -995,12 +995,12 @@
  *
  *-----------------------------------------------------------------------
  */
-int
+time_t
 Arch_MTime (gn)
     GNode	  *gn;	      /* Node describing archive member */
 {
     struct ar_hdr *arhPtr;    /* Header of desired member */
-    int		  modTime;    /* Modification time as an integer */
+    time_t	  modTime;    /* Modification time as an integer */
     char *p1, *p2;
 
     arhPtr = ArchStatMember (Var_Value (ARCHIVE, gn, &p1),
@@ -1012,7 +1012,7 @@
 	free(p2);
 
     if (arhPtr != (struct ar_hdr *) NULL) {
-	modTime = (int) strtol(arhPtr->ar_date, NULL, 10);
+	modTime = (time_t) strtol(arhPtr->ar_date, NULL, 10);
     } else {
 	modTime = 0;
     }
@@ -1035,7 +1035,7 @@
  *
  *-----------------------------------------------------------------------
  */
-int
+time_t
 Arch_MemMTime (gn)
     GNode   	  *gn;
 {
Index: make.h
===================================================================
RCS file: /home/vino/repo/src/tools/make/make.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 make.h
--- make.h	1997/04/14 21:01:42	1.1.1.2
+++ make.h	1997/09/11 19:18:38
@@ -144,8 +144,8 @@
 				 * made */
     int             unmade;    	/* The number of unmade children */
 
-    int             mtime;     	/* Its modification time */
-    int        	    cmtime;    	/* The modification time of its youngest
+    time_t          mtime;     	/* Its modification time */
+    time_t     	    cmtime;    	/* The modification time of its youngest
 				 * child */
 
     Lst     	    iParents;  	/* Links to parents for which this is an
Index: nonints.h
===================================================================
RCS file: /home/vino/repo/src/tools/make/nonints.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 nonints.h
--- nonints.h	1997/04/14 21:01:43	1.1.1.2
+++ nonints.h	1997/09/11 19:20:48
@@ -44,8 +44,8 @@
 ReturnStatus Arch_ParseArchive __P((char **, Lst, GNode *));
 void Arch_Touch __P((GNode *));
 void Arch_TouchLib __P((GNode *));
-int Arch_MTime __P((GNode *));
-int Arch_MemMTime __P((GNode *));
+time_t Arch_MTime __P((GNode *));
+time_t Arch_MemMTime __P((GNode *));
 void Arch_FindLib __P((GNode *, Lst));
 Boolean Arch_LibOODate __P((GNode *));
 void Arch_Init __P((void));
>Audit-Trail:
>Unformatted: