Module Name: src
Committed By: rillig
Date: Mon Feb 1 18:55:16 UTC 2021
Modified Files:
src/usr.bin/make: job.c lst.c lst.h
Log Message:
make: remove unused Lst_Destroy
The code in job.c that seemed to use it is inside an '#if 0' block.
To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 src/usr.bin/make/job.c
cvs rdiff -u -r1.102 -r1.103 src/usr.bin/make/lst.c
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/lst.h
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/job.c
diff -u src/usr.bin/make/job.c:1.409 src/usr.bin/make/job.c:1.410
--- src/usr.bin/make/job.c:1.409 Mon Feb 1 18:46:38 2021
+++ src/usr.bin/make/job.c Mon Feb 1 18:55:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.409 2021/02/01 18:46:38 rillig Exp $ */
+/* $NetBSD: job.c,v 1.410 2021/02/01 18:55:15 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.409 2021/02/01 18:46:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.410 2021/02/01 18:55:15 rillig Exp $");
/*
* A shell defines how the commands are run. All commands for a target are
@@ -1934,11 +1934,11 @@ JobRun(GNode *targ)
* Running these jobs in compat mode also guarantees that these
* jobs do not overlap with other unrelated jobs.
*/
- List *lst = Lst_New();
- Lst_Append(lst, targ);
- (void)Make_Run(lst);
- Lst_Destroy(lst, NULL);
- JobStart(targ, JOB_SPECIAL);
+ GNodeList lst = LST_INIT;
+ Lst_Append(&lst, targ);
+ (void)Make_Run(&lst);
+ Lst_Done(&lst);
+ JobStart(targ, TRUE);
while (jobTokensRunning != 0) {
Job_CatchOutput();
}
Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.102 src/usr.bin/make/lst.c:1.103
--- src/usr.bin/make/lst.c:1.102 Wed Dec 30 10:03:16 2020
+++ src/usr.bin/make/lst.c Mon Feb 1 18:55:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.102 2020/12/30 10:03:16 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.103 2021/02/01 18:55:15 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
#include "make.h"
-MAKE_RCSID("$NetBSD: lst.c,v 1.102 2020/12/30 10:03:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.103 2021/02/01 18:55:15 rillig Exp $");
static ListNode *
LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@@ -89,17 +89,6 @@ Lst_Free(List *list)
free(list);
}
-/*
- * Destroy a list and free all its resources. The freeProc is called with the
- * datum from each node in turn before the node is freed.
- */
-void
-Lst_Destroy(List *list, LstFreeProc freeProc)
-{
- Lst_DoneCall(list, freeProc);
- free(list);
-}
-
/* Insert a new node with the datum before the given node. */
void
Lst_InsertBefore(List *list, ListNode *ln, void *datum)
Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.95 src/usr.bin/make/lst.h:1.96
--- src/usr.bin/make/lst.h:1.95 Sun Jan 3 21:12:03 2021
+++ src/usr.bin/make/lst.h Mon Feb 1 18:55:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.95 2021/01/03 21:12:03 rillig Exp $ */
+/* $NetBSD: lst.h,v 1.96 2021/02/01 18:55:15 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -111,8 +111,6 @@ void Lst_Done(List *);
void Lst_DoneCall(List *, LstFreeProc);
/* Free the list, leaving the node data unmodified. */
void Lst_Free(List *);
-/* Free the list, freeing the node data using the given function. */
-void Lst_Destroy(List *, LstFreeProc);
#define LST_INIT { NULL, NULL }