From 003ef929d029e58b546a99f6149d19d9a6583132 Mon Sep 17 00:00:00 2001 From: Max Okumoto Date: Sat, 2 Jul 2005 10:45:29 +0000 Subject: [PATCH] Moved exit status code into subroutine Make_Run() --- usr.bin/make/main.c | 8 +++----- usr.bin/make/make.c | 39 ++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index e0d18bfcfc..c068b7edc5 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -38,7 +38,7 @@ * @(#) Copyright (c) 1988, 1989, 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.3 (Berkeley) 3/19/94 * $FreeBSD: src/usr.bin/make/main.c,v 1.118 2005/02/13 13:33:56 harti Exp $ - * $DragonFly: src/usr.bin/make/main.c,v 1.130 2005/06/22 22:03:36 okumoto Exp $ + * $DragonFly: src/usr.bin/make/main.c,v 1.131 2005/07/02 10:45:29 okumoto Exp $ */ /* @@ -872,12 +872,10 @@ build_stuff(CLI *cli) if (compatMake) { status = Compat_Run(&targs, cli->queryFlag); } else { - Boolean outOfDate; - outOfDate = Make_Run(&targs, cli->queryFlag); - status = (cli->queryFlag && outOfDate) ? 1 : 0; + status = Make_Run(&targs, cli->queryFlag); } - Lst_Destroy(&targs, NOFREE); + Lst_Destroy(&targs, NOFREE); return (status); } diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 7e2b875036..7ff1c85f99 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -37,7 +37,7 @@ * * @(#)make.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/make/make.c,v 1.33 2005/02/04 12:38:57 harti Exp $ - * $DragonFly: src/usr.bin/make/make.c,v 1.30 2005/06/21 21:04:32 okumoto Exp $ + * $DragonFly: src/usr.bin/make/make.c,v 1.31 2005/07/02 10:45:29 okumoto Exp $ */ /* @@ -97,8 +97,6 @@ static Lst toBeMade = Lst_Initializer(toBeMade); */ static int numNodes; -static Boolean MakeStartJobs(Boolean); - /** * Make_TimeStamp * Set the cmtime field of a parent node based on the mtime stamp in its @@ -569,13 +567,13 @@ Make_DoAllVar(GNode *gn) * Results: * If the query flag was given to pmake, no job will be started, * but as soon as an out-of-date target is found, this function - * returns TRUE. At all other times, this function returns FALSE. + * returns 1. At all other times, this function returns 0. * * Side Effects: * Nodes are removed from the toBeMade queue and job table slots * are filled. */ -static Boolean +static int MakeStartJobs(Boolean queryFlag) { GNode *gn; @@ -617,7 +615,7 @@ MakeStartJobs(Boolean queryFlag) if (Make_OODate(gn)) { DEBUGF(MAKE, ("out-of-date\n")); if (queryFlag) { - return (TRUE); + return (1); /* target was not up-to-date */ } Make_DoAllVar(gn); Job_Make(gn); @@ -638,7 +636,7 @@ MakeStartJobs(Boolean queryFlag) Make_Update(gn); } } - return (FALSE); + return (0); /* Successful completion */ } /** @@ -702,7 +700,7 @@ MakePrintStatus(GNode *gn, Boolean cycle) * possible. * * Results: - * TRUE if work was done. FALSE otherwise. + * Exit status of make. * * Side Effects: * The make field of all nodes involved in the creation of the given @@ -779,19 +777,18 @@ Make_Run(Lst *targs, Boolean queryFlag) * the next loop... (we won't actually start any, of course, * this is just to see if any of the targets was out of date) */ - return (MakeStartJobs(queryFlag)); - - } else { - /* - * Initialization. At the moment, no jobs are running and - * until some get started, nothing will happen since the - * remaining upward traversal of the graph is performed by the - * routines in job.c upon the finishing of a job. So we fill - * the Job table as much as we can before going into our loop. - */ - MakeStartJobs(queryFlag); + return MakeStartJobs(TRUE); } + /* + * Initialization. At the moment, no jobs are running and + * until some get started, nothing will happen since the + * remaining upward traversal of the graph is performed by the + * routines in job.c upon the finishing of a job. So we fill + * the Job table as much as we can before going into our loop. + */ + MakeStartJobs(FALSE); + /* * Main Loop: The idea here is that the ending of jobs will take * care of the maintenance of data structures and the waiting for output @@ -805,7 +802,7 @@ Make_Run(Lst *targs, Boolean queryFlag) while (!Job_Empty()) { Job_CatchOutput(!Lst_IsEmpty(&toBeMade)); Job_CatchChildren(!usePipes); - MakeStartJobs(queryFlag); + MakeStartJobs(FALSE); } errors = Job_Finish(); @@ -818,5 +815,5 @@ Make_Run(Lst *targs, Boolean queryFlag) LST_FOREACH(ln, targs) MakePrintStatus(Lst_Datum(ln), errors); - return (TRUE); + return 0; /* Successful completion */ } -- 2.41.0