diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-09-14 13:52:43 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-09-14 13:52:43 +0000 |
commit | 52f00e4396ef3d5f47122233da72feb932ce3f8e (patch) | |
tree | 3eb6b0c9bff2378bef6d289969deac7e031da6cc /usr.bin/make/arch.c | |
parent | cc11fcd76306cd4861949984c169afd9d9b1f759 (diff) |
Introduce a few macros to handle timestamps in an abstract way.
Replace the time stamp hash in dir.c with an open hashing structure.
In doing so, remove some nasty casts, simplify code a bit:
Dir_MTime can return a modification time, since make does not make
a distinction between out-of-date and non-existent files.
Diffstat (limited to 'usr.bin/make/arch.c')
-rw-r--r-- | usr.bin/make/arch.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 959641603ef..30df6314ee0 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arch.c,v 1.33 2000/09/14 13:46:44 espie Exp $ */ +/* $OpenBSD: arch.c,v 1.34 2000/09/14 13:52:41 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -109,7 +109,7 @@ static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else UNUSED -static char rcsid[] = "$OpenBSD: arch.c,v 1.33 2000/09/14 13:46:44 espie Exp $"; +static char rcsid[] = "$OpenBSD: arch.c,v 1.34 2000/09/14 13:52:41 espie Exp $"; #endif #endif /* not lint */ @@ -998,15 +998,14 @@ Arch_TouchLib (gn) * Return the modification time of a member of an archive. * * Results: - * TRUE if found. + * The modification time (seconds). * * Side Effects: * The mtime field of the given node is filled in with the value * returned by the function. - * *----------------------------------------------------------------------- */ -Boolean +TIMESTAMP Arch_MTime (gn) GNode *gn; /* Node describing archive member */ { @@ -1015,13 +1014,11 @@ Arch_MTime (gn) arhPtr = ArchStatMember(Varq_Value(ARCHIVE_INDEX, gn), Varq_Value(MEMBER_INDEX, gn), TRUE); - if (arhPtr != NULL) { + if (arhPtr != NULL) gn->mtime = (time_t) strtol(arhPtr->ar_date, NULL, 10); - return TRUE; - } else { + else gn->mtime = OUT_OF_DATE; - return FALSE; - } + return gn->mtime; } /*- |