diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 4ea872af2c23..d1364a7aed1a 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.233 2020/11/29 10:57:16 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.234 2020/11/29 11:17:41 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -136,7 +136,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.233 2020/11/29 10:57:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.234 2020/11/29 11:17:41 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -225,6 +225,7 @@ struct CachedDir { /* * The number of SearchPaths that refer to this directory. * Plus the number of global variables that refer to this directory. + * References from openDirs do not count though. * * TODO: Check the reference counting; see Dir_Expand, partPath. */ @@ -1521,6 +1522,7 @@ Dir_AddDir(SearchPath *path, const char *name) (void)HashSet_Add(&dir->files, dp->d_name); } (void)closedir(d); + OpenDirs_Add(&openDirs, dir); if (path != NULL) Lst_Append(path, dir);