--- src/usr.bin/make/job.c 2004/11/12 21:52:04 1.7 +++ src/usr.bin/make/job.c 2004/11/12 22:02:51 1.8 @@ -1,5 +1,6 @@ /* - * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. + * Copyright (c) 1988, 1989, 1990, 1993 + * The Regents of the University of California. All rights reserved. * Copyright (c) 1988, 1989 by Adam de Boor * Copyright (c) 1989 by Berkeley Softworks * All rights reserved. @@ -81,7 +82,7 @@ * the line as a shell specification. Returns * FAILURE if the spec was incorrect. * - * Job_End Perform any final processing which needs doing. + * Job_Finish Perform any final processing which needs doing. * This includes the execution of any commands * which have been/were attached to the .END * target. It should only be called when the @@ -487,7 +488,7 @@ JobCmpRmtID(job, rmtID) * job to be commands to be executed once the entire graph has been * made and return non-zero to signal that the end of the commands * was reached. These commands are later attached to the postCommands - * node and executed by Job_End when all things are done. + * node and executed by Job_Finish when all things are done. * This function is called from JobStart via Lst_ForEach. * * Results: @@ -803,6 +804,8 @@ JobFinish(job, status) * output file as well. */ out = fdopen(job->outFd, "w"); + if (out == NULL) + Punt("Cannot fdopen"); } else { out = stdout; } @@ -1655,7 +1658,7 @@ JobStart(gn, flags, previous) Job *previous; /* The previous Job structure for this node, * if any. */ { - register Job *job; /* new job descriptor */ + Job *job; /* new job descriptor */ char *argv[4]; /* Argument vector to shell */ Boolean cmdsOK; /* true if the nodes commands were all right */ Boolean local; /* Set true if the job was run locally */ @@ -1947,11 +1950,11 @@ JobStart(gn, flags, previous) static char * JobOutput(job, cp, endp, msg) - register Job *job; - register char *cp, *endp; + Job *job; + char *cp, *endp; int msg; { - register char *ecp; + char *ecp; if (commandShell->noPrint) { ecp = Str_FindSubstring(cp, commandShell->noPrint); @@ -2020,15 +2023,15 @@ JobOutput(job, cp, endp, msg) */ STATIC void JobDoOutput(job, finish) - register Job *job; /* the job whose output needs printing */ + Job *job; /* the job whose output needs printing */ Boolean finish; /* TRUE if this is the last time we'll be * called for this job */ { Boolean gotNL = FALSE; /* true if got a newline */ Boolean fbuf; /* true if our buffer filled up */ - register int nr; /* number of bytes read */ - register int i; /* auxiliary index into outBuf */ - register int max; /* limit for i (end of current data) */ + int nr; /* number of bytes read */ + int i; /* auxiliary index into outBuf */ + int max; /* limit for i (end of current data) */ int nRead; /* (Temporary) number of bytes read */ FILE *oFILE; /* Stream pointer to shell's output file */ @@ -2168,7 +2171,7 @@ end_loop: (void) fprintf(stdout, "Results of making %s:\n", job->node->name); (void) fflush(stdout); while (fgets(inLine, sizeof(inLine), oFILE) != NULL) { - register char *cp, *endp, *oendp; + char *cp, *endp, *oendp; cp = inLine; oendp = endp = inLine + strlen(inLine); @@ -2219,7 +2222,7 @@ Job_CatchChildren(block) Boolean block; /* TRUE if should block on the wait. */ { int pid; /* pid of dead child */ - register Job *job; /* job descriptor for dead child */ + Job *job; /* job descriptor for dead child */ LstNode jnode; /* list element for finding job */ int status; /* Exit/termination status */ @@ -2303,8 +2306,8 @@ Job_CatchOutput() int nfds; struct timeval timeout; fd_set readfds; - register LstNode ln; - register Job *job; + LstNode ln; + Job *job; #ifdef RMT_WILL_WATCH int pnJobs; /* Previous nJobs */ #endif @@ -2570,9 +2573,9 @@ static Shell * JobMatchShell(name) char *name; /* Final component of shell path */ { - register Shell *sh; /* Pointer into shells table */ - Shell *match; /* Longest-matching shell */ - register char *cp1, + Shell *sh; /* Pointer into shells table */ + Shell *match; /* Longest-matching shell */ + char *cp1, *cp2; char *eoname; @@ -2644,8 +2647,8 @@ Job_ParseShell(line) { char **words; int wordCount; - register char **argv; - register int argc; + char **argv; + int argc; char *path; Shell newShell; Boolean fullSpec = FALSE; @@ -2901,7 +2904,7 @@ JobInterrupt(runINTERRUPT, signo) /* *----------------------------------------------------------------------- - * Job_End -- + * Job_Finish -- * Do final processing such as the running of the commands * attached to the .END target. * @@ -2910,7 +2913,7 @@ JobInterrupt(runINTERRUPT, signo) *----------------------------------------------------------------------- */ int -Job_End() +Job_Finish() { if (postCommands != NULL && !Lst_IsEmpty(postCommands->commands)) { if (errors) { @@ -3030,7 +3033,7 @@ void JobFlagForMigration(hostID) int hostID; /* ID of host we used, for matching children. */ { - register Job *job; /* job descriptor for dead child */ + Job *job; /* job descriptor for dead child */ LstNode jnode; /* list element for finding job */ if (DEBUG(JOB)) {