diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2013-05-30 08:58:39 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2013-05-30 08:58:39 +0000 |
commit | 5dfabbf94fdc3d999cd9908b1fafb8e06071e8e1 (patch) | |
tree | a5424e31c716d4047ec928eaf9b08969ea81d894 /usr.bin/make | |
parent | 11b189bb6ad3316b1b0f3106fa9353489bcf6495 (diff) |
remove cmtime again, but with a proper test for nodes without children.
problem seen by aja,
make pointed by matthieu,
sleuthing by me,
okay by millert
(and you say OpenBSD developers don't work together)
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/compat.c | 10 | ||||
-rw-r--r-- | usr.bin/make/engine.c | 15 | ||||
-rw-r--r-- | usr.bin/make/gnode.h | 4 | ||||
-rw-r--r-- | usr.bin/make/targ.c | 3 |
4 files changed, 14 insertions, 18 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 91e20e53262..4e81db02377 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.81 2013/05/25 11:54:14 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.82 2013/05/30 08:58:38 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -217,15 +217,15 @@ CompatMake(void *gnp, /* The node to make */ */ if (noExecute || is_out_of_date(Dir_MTime(gn))) clock_gettime(CLOCK_REALTIME, &gn->mtime); - if (is_strictly_before(gn->mtime, gn->cmtime)) - gn->mtime = gn->cmtime; + if (is_strictly_before(gn->mtime, gn->youngest->mtime)) + gn->mtime = gn->youngest->mtime; if (sib != gn) { if (noExecute || is_out_of_date(Dir_MTime(sib))) clock_gettime(CLOCK_REALTIME, &sib->mtime); if (is_strictly_before(sib->mtime, - sib->cmtime)) - sib->mtime = sib->cmtime; + sib->youngest->mtime)) + sib->mtime = sib->youngest->mtime; } if (DEBUG(MAKE)) printf("update time: %s\n", diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c index f40fd03c6fd..ddc8dbc1010 100644 --- a/usr.bin/make/engine.c +++ b/usr.bin/make/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.44 2013/05/25 11:54:14 espie Exp $ */ +/* $OpenBSD: engine.c,v 1.45 2013/05/30 08:58:38 espie Exp $ */ /* * Copyright (c) 2012 Marc Espie. * @@ -286,9 +286,8 @@ Job_Touch(GNode *gn) void Make_TimeStamp(GNode *parent, GNode *child) { - if (is_strictly_before(parent->cmtime, child->mtime)) { + if (is_strictly_before(parent->youngest->mtime, child->mtime)) { parent->youngest = child; - parent->cmtime = child->mtime; } } @@ -491,17 +490,17 @@ Make_OODate(GNode *gn) printf(".EXEC node..."); } oodate = true; - } else if (is_strictly_before(gn->mtime, gn->cmtime) || - (is_out_of_date(gn->cmtime) && + } else if (is_strictly_before(gn->mtime, gn->youngest->mtime) || + (gn == gn->youngest && (is_out_of_date(gn->mtime) || (gn->type & OP_DOUBLEDEP)))) { /* * A node whose modification time is less than that of its - * youngest child or that has no children (cmtime == - * OUT_OF_DATE) and either doesn't exist (mtime == OUT_OF_DATE) + * youngest child or that has no children (gn->youngest == gn) + * and either doesn't exist (mtime == OUT_OF_DATE) * or was the object of a :: operator is out-of-date. */ if (DEBUG(MAKE)) { - if (is_strictly_before(gn->mtime, gn->cmtime)) + if (is_strictly_before(gn->mtime, gn->youngest->mtime)) printf("modified before source(%s)...", gn->youngest->name); else if (is_out_of_date(gn->mtime)) diff --git a/usr.bin/make/gnode.h b/usr.bin/make/gnode.h index 77dc98c6bc8..e5b34ab377a 100644 --- a/usr.bin/make/gnode.h +++ b/usr.bin/make/gnode.h @@ -1,6 +1,6 @@ #ifndef GNODE_H #define GNODE_H -/* $OpenBSD: gnode.h,v 1.27 2013/05/25 11:54:14 espie Exp $ */ +/* $OpenBSD: gnode.h,v 1.28 2013/05/30 08:58:38 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -144,8 +144,6 @@ struct GNode_ { int unmade; /* The number of unmade children */ struct timespec mtime; /* Its modification time */ - struct timespec cmtime; /* The modification time of its youngest - * child */ GNode *youngest; /* Its youngest child */ GNode *impliedsrc; diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 8d87d940477..ec04e3b3378 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.73 2013/05/25 11:54:14 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.74 2013/05/30 08:58:38 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -158,7 +158,6 @@ Targ_NewGNi(const char *name, const char *ename) gn->childMade = false; gn->order = 0; ts_set_out_of_date(gn->mtime); - ts_set_out_of_date(gn->cmtime); gn->youngest = gn; Lst_Init(&gn->cohorts); Lst_Init(&gn->parents); |