=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/arch.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/make/arch.c 2000/01/08 09:45:15 1.24 --- src/usr.bin/make/arch.c 2000/02/02 13:47:46 1.25 *************** *** 1,4 **** ! /* $OpenBSD: arch.c,v 1.24 2000/01/08 09:45:15 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: arch.c,v 1.25 2000/02/02 13:47:46 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else ! static char rcsid[] = "$OpenBSD: arch.c,v 1.24 2000/01/08 09:45:15 espie Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else ! static char rcsid[] = "$OpenBSD: arch.c,v 1.25 2000/02/02 13:47:46 espie Exp $"; #endif #endif /* not lint */ *************** *** 73,81 **** * of the library's table of contents. * * Arch_MTime Find the modification time of a member of ! * an archive *in the archive*. The time is also ! * placed in the member's GNode. Returns the ! * modification time. * * Arch_MemTime Find the modification time of a member of * an archive. Called when the member doesn't --- 73,81 ---- * of the library's table of contents. * * Arch_MTime Find the modification time of a member of ! * an archive *in the archive*, return TRUE if ! * exists. The time is placed in the member's ! * GNode. Returns the modification time. * * Arch_MemTime Find the modification time of a member of * an archive. Called when the member doesn't *************** *** 995,1001 **** * Return the modification time of a member of an archive. * * Results: ! * The modification time (seconds). * * Side Effects: * The mtime field of the given node is filled in with the value --- 995,1001 ---- * Return the modification time of a member of an archive. * * Results: ! * TRUE if found. * * Side Effects: * The mtime field of the given node is filled in with the value *************** *** 1003,1009 **** * *----------------------------------------------------------------------- */ ! time_t Arch_MTime (gn) GNode *gn; /* Node describing archive member */ { --- 1003,1009 ---- * *----------------------------------------------------------------------- */ ! Boolean Arch_MTime (gn) GNode *gn; /* Node describing archive member */ { *************** *** 1014,1026 **** Var_Value(MEMBER, gn), TRUE); if (arhPtr != NULL) { ! modTime = (time_t) strtol(arhPtr->ar_date, NULL, 10); } else { ! modTime = 0; } - - gn->mtime = modTime; - return (modTime); } /*- --- 1014,1025 ---- Var_Value(MEMBER, gn), TRUE); if (arhPtr != NULL) { ! gn->mtime = (time_t) strtol(arhPtr->ar_date, NULL, 10); ! return TRUE; } else { ! gn->mtime = OUT_OF_DATE; ! return FALSE; } } /*- *************** *** 1030,1043 **** * time from its archived form, if it exists. * * Results: ! * The modification time. * * Side Effects: * The mtime field is filled in. * *----------------------------------------------------------------------- */ ! time_t Arch_MemMTime (gn) GNode *gn; { --- 1029,1042 ---- * time from its archived form, if it exists. * * Results: ! * TRUE if found. * * Side Effects: * The mtime field is filled in. * *----------------------------------------------------------------------- */ ! Boolean Arch_MemMTime (gn) GNode *gn; { *************** *** 1047,1054 **** *nameEnd; if (Lst_Open (gn->parents) != SUCCESS) { ! gn->mtime = 0; ! return (0); } while ((ln = Lst_Next (gn->parents)) != NULL) { pgn = (GNode *) Lst_Datum (ln); --- 1046,1053 ---- *nameEnd; if (Lst_Open (gn->parents) != SUCCESS) { ! gn->mtime = OUT_OF_DATE; ! return FALSE; } while ((ln = Lst_Next (gn->parents)) != NULL) { pgn = (GNode *) Lst_Datum (ln); *************** *** 1070,1090 **** if (pgn->make && nameEnd != NULL && strncmp(nameStart, gn->name, nameEnd - nameStart) == 0) { ! gn->mtime = Arch_MTime(pgn); } } else if (pgn->make) { /* * Something which isn't a library depends on the existence of * this target, so it needs to exist. */ ! gn->mtime = 0; break; } } Lst_Close (gn->parents); ! return (gn->mtime); } /*- --- 1069,1092 ---- if (pgn->make && nameEnd != NULL && strncmp(nameStart, gn->name, nameEnd - nameStart) == 0) { ! if (Arch_MTime(pgn)) ! gn->mtime = pgn->mtime; ! else ! gn->mtime = OUT_OF_DATE; } } else if (pgn->make) { /* * Something which isn't a library depends on the existence of * this target, so it needs to exist. */ ! gn->mtime = OUT_OF_DATE; break; } } Lst_Close (gn->parents); ! return gn->mtime == OUT_OF_DATE; } /*- *************** *** 1172,1188 **** if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { oodate = FALSE; ! } else if ((gn->mtime > now) || (gn->mtime < gn->cmtime) || !gn->mtime) { ! oodate = TRUE; } else { #ifdef RANLIBMAG struct ar_hdr *arhPtr; /* Header for __.SYMDEF */ ! int modTimeTOC; /* The table-of-contents's mod time */ arhPtr = ArchStatMember (gn->path, RANLIBMAG, FALSE); if (arhPtr != NULL) { ! modTimeTOC = (int) strtol(arhPtr->ar_date, NULL, 10); if (DEBUG(ARCH) || DEBUG(MAKE)) { printf("%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC)); --- 1174,1191 ---- if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { oodate = FALSE; ! } else if (gn->mtime > now || gn->mtime < gn->cmtime || ! gn->mtime == OUT_OF_DATE) { ! oodate = TRUE; } else { #ifdef RANLIBMAG struct ar_hdr *arhPtr; /* Header for __.SYMDEF */ ! time_t modTimeTOC; /* The table-of-contents's mod time */ arhPtr = ArchStatMember (gn->path, RANLIBMAG, FALSE); if (arhPtr != NULL) { ! modTimeTOC = (time_t) strtol(arhPtr->ar_date, NULL, 10); if (DEBUG(ARCH) || DEBUG(MAKE)) { printf("%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC));