make(1): replace Lst_Open with direct iteration

This commit is contained in:
rillig 2020-09-28 23:31:18 +00:00
parent 35a8c8e3ca
commit 8644c277f7
2 changed files with 8 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $ */
/* $NetBSD: job.c,v 1.253 2020/09/28 23:31:18 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -143,7 +143,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
MAKE_RCSID("$NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $");
MAKE_RCSID("$NetBSD: job.c,v 1.253 2020/09/28 23:31:18 rillig Exp $");
# define STATIC static
@ -871,7 +871,7 @@ JobFinish(Job *job, int status)
{
Boolean done, return_job_token;
DEBUG3(JOB, "Jobfinish: %d [%s], status %d\n",
DEBUG3(JOB, "JobFinish: %d [%s], status %d\n",
job->pid, job->node->name, status);
if ((WIFEXITED(status) &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $ */
/* $NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -122,7 +122,7 @@
#include "dir.h"
/* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */
MAKE_RCSID("$NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $");
MAKE_RCSID("$NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $");
static GNodeList *allTargets; /* the list of all targets found so far */
#ifdef CLEANUP
@ -292,18 +292,13 @@ GNode *Targ_GetEndNode(void)
GNodeList *
Targ_FindList(StringList *names)
{
GNodeList *nodes;
StringListNode *ln;
nodes = Lst_Init();
Lst_Open(names);
while ((ln = Lst_Next(names)) != NULL) {
char *name = LstNode_Datum(ln);
GNodeList *nodes = Lst_Init();
for (ln = names->first; ln != NULL; ln = ln->next) {
const char *name = ln->datum;
GNode *gn = Targ_GetNode(name);
Lst_Append(nodes, gn);
}
Lst_Close(names);
return nodes;
}