Module Name: src
Committed By: rillig
Date: Sun Nov 29 16:04:34 UTC 2020
Modified Files:
src/usr.bin/make: dir.c
Log Message:
make(1): move CachedDir_Destroy up to the related functions
To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/make/dir.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.238 src/usr.bin/make/dir.c:1.239
--- src/usr.bin/make/dir.c:1.238 Sun Nov 29 15:58:37 2020
+++ src/usr.bin/make/dir.c Sun Nov 29 16:04:34 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.238 2020/11/29 15:58:37 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.239 2020/11/29 16:04:34 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.238 2020/11/29 15:58:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.239 2020/11/29 16:04:34 rillig Exp $");
#define DIR_DEBUG0(text) DEBUG0(DIR, text)
#define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -286,7 +286,6 @@ static HashTable mtimes;
static HashTable lmtimes; /* same as mtimes but for lstat */
-static void CachedDir_Destroy(CachedDir *);
static void OpenDirs_Remove(OpenDirs *, const char *);
@@ -332,6 +331,16 @@ CachedDir_Unref(CachedDir *dir)
dir->refCount, dir->name);
}
+/* Nuke a directory descriptor, if it is no longer used. */
+static void
+CachedDir_Destroy(CachedDir *dir)
+{
+ CachedDir_Unref(dir);
+
+ if (dir->refCount == 0)
+ CachedDir_Free0(dir);
+}
+
static void
OpenDirs_Init(OpenDirs *odirs)
{
@@ -1614,16 +1623,6 @@ SearchPath_ToFlags(const char *flag, Sea
return Buf_Destroy(&buf, FALSE);
}
-/* Nuke a directory descriptor, if it is no longer used. */
-static void
-CachedDir_Destroy(CachedDir *dir)
-{
- CachedDir_Unref(dir);
-
- if (dir->refCount == 0)
- CachedDir_Free0(dir);
-}
-
/* Free the search path and all directories mentioned in it. */
void
SearchPath_Free(SearchPath *path)