=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/job.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/make/job.c 1999/12/18 02:11:26 1.17 --- src/usr.bin/make/job.c 1999/12/18 21:53:32 1.18 *************** *** 1,4 **** ! /* $OpenBSD: job.c,v 1.17 1999/12/18 02:11:26 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: job.c,v 1.18 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: job.c,v 1.17 1999/12/18 02:11:26 espie Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: job.c,v 1.18 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ *************** *** 967,973 **** * the parents. In addition, any saved commands for the node are placed * on the .END target. */ ! if (job->tailCmds != NILLNODE) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); --- 967,973 ---- * the parents. In addition, any saved commands for the node are placed * on the .END target. */ ! if (job->tailCmds != NULL) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); *************** *** 1101,1107 **** * No commands. Look for .DEFAULT rule from which we might infer * commands */ ! if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands)) { /* * Make only looks for a .DEFAULT if the node was never the * target of an operator, so that's what we do too. If --- 1101,1107 ---- * No commands. Look for .DEFAULT rule from which we might infer * commands */ ! if ((DEFAULT != NULL) && !Lst_IsEmpty(DEFAULT->commands)) { /* * Make only looks for a .DEFAULT if the node was never the * target of an operator, so that's what we do too. If *************** *** 1692,1698 **** } job->node = gn; ! job->tailCmds = NILLNODE; /* * Set the initial value of the flags for this job based on the global --- 1692,1698 ---- } job->node = gn; ! job->tailCmds = NULL; /* * Set the initial value of the flags for this job based on the global *************** *** 1762,1768 **** } else { LstNode ln = Lst_Next(gn->commands); ! if ((ln == NILLNODE) || JobPrintCommand((ClientData) Lst_Datum(ln), (ClientData) job)) { --- 1762,1768 ---- } else { LstNode ln = Lst_Next(gn->commands); ! if ((ln == NULL) || JobPrintCommand((ClientData) Lst_Datum(ln), (ClientData) job)) { *************** *** 1854,1860 **** */ if (cmdsOK) { if (aborting == 0) { ! if (job->tailCmds != NILLNODE) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); --- 1854,1860 ---- */ if (cmdsOK) { if (aborting == 0) { ! if (job->tailCmds != NULL) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); *************** *** 2255,2264 **** jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid); ! if (jnode == NILLNODE) { if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid); ! if (jnode == NILLNODE) { Error("Resumed child (%d) not in table", pid); continue; } --- 2255,2264 ---- jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid); ! if (jnode == NULL) { if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid); ! if (jnode == NULL) { Error("Resumed child (%d) not in table", pid); continue; } *************** *** 2365,2371 **** free(readfdsp); Punt("Cannot open job table"); } ! while (nfds && (ln = Lst_Next(jobs)) != NILLNODE) { job = (Job *) Lst_Datum(ln); if (FD_ISSET(job->inPipe, readfdsp)) { JobDoOutput(job, FALSE); --- 2365,2371 ---- free(readfdsp); Punt("Cannot open job table"); } ! while (nfds && (ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (FD_ISSET(job->inPipe, readfdsp)) { JobDoOutput(job, FALSE); *************** *** 2439,2445 **** aborting = 0; errors = 0; ! lastNode = NILGNODE; if (maxJobs == 1 #ifdef REMOTE --- 2439,2445 ---- aborting = 0; errors = 0; ! lastNode = NULL; if (maxJobs == 1 #ifdef REMOTE *************** *** 2513,2519 **** begin = Targ_FindNode(".BEGIN", TARG_NOCREATE); ! if (begin != NILGNODE) { JobStart(begin, JOB_SPECIAL, (Job *)0); while (nJobs) { Job_CatchOutput(); --- 2513,2519 ---- begin = Targ_FindNode(".BEGIN", TARG_NOCREATE); ! if (begin != NULL) { JobStart(begin, JOB_SPECIAL, (Job *)0); while (nJobs) { Job_CatchOutput(); *************** *** 2817,2823 **** aborting = ABORT_INTERRUPT; (void) Lst_Open(jobs); ! while ((ln = Lst_Next(jobs)) != NILLNODE) { job = (Job *) Lst_Datum(ln); if (!Targ_Precious(job->node)) { --- 2817,2823 ---- aborting = ABORT_INTERRUPT; (void) Lst_Open(jobs); ! while ((ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (!Targ_Precious(job->node)) { *************** *** 2862,2868 **** #ifdef REMOTE (void)Lst_Open(stoppedJobs); ! while ((ln = Lst_Next(stoppedJobs)) != NILLNODE) { job = (Job *) Lst_Datum(ln); if (job->flags & JOB_RESTART) { --- 2862,2868 ---- #ifdef REMOTE (void)Lst_Open(stoppedJobs); ! while ((ln = Lst_Next(stoppedJobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (job->flags & JOB_RESTART) { *************** *** 2923,2929 **** if (runINTERRUPT && !touchFlag) { interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); ! if (interrupt != NILGNODE) { ignoreErrors = FALSE; JobStart(interrupt, JOB_IGNDOTS, (Job *)0); --- 2923,2929 ---- if (runINTERRUPT && !touchFlag) { interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); ! if (interrupt != NULL) { ignoreErrors = FALSE; JobStart(interrupt, JOB_IGNDOTS, (Job *)0); *************** *** 2956,2962 **** int Job_Finish() { ! if (postCommands != NILGNODE && !Lst_IsEmpty(postCommands->commands)) { if (errors) { Error("Errors reported so .END ignored"); } else { --- 2956,2962 ---- int Job_Finish() { ! if (postCommands != NULL && !Lst_IsEmpty(postCommands->commands)) { if (errors) { Error("Errors reported so .END ignored"); } else { *************** *** 3047,3053 **** if (nJobs) { (void) Lst_Open(jobs); ! while ((ln = Lst_Next(jobs)) != NILLNODE) { job = (Job *) Lst_Datum(ln); /* --- 3047,3053 ---- if (nJobs) { (void) Lst_Open(jobs); ! while ((ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); /* *************** *** 3105,3113 **** } jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); ! if (jnode == NILLNODE) { jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); ! if (jnode == NILLNODE) { if (DEBUG(JOB)) { Error("Evicting host(%d) not in table", hostID); } --- 3105,3113 ---- } jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); ! if (jnode == NULL) { jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); ! if (jnode == NULL) { if (DEBUG(JOB)) { Error("Evicting host(%d) not in table", hostID); }