[BACK]Return to job.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/job.c between version 1.29 and 1.30

version 1.29, 2000/06/17 14:38:15 version 1.30, 2000/06/23 16:15:49
Line 1739 
Line 1739 
          * per shell.           * per shell.
          */           */
         if (compatMake) {          if (compatMake) {
               LstNode ln;
             /*              /*
              * Be compatible: If this is the first time for this node,               * Be compatible: If this is the first time for this node,
              * verify its commands are ok and open the commands list for               * verify its commands are ok and open the commands list for
Line 1747 
Line 1748 
              * and print it to the command file. If the command was an               * and print it to the command file. If the command was an
              * ellipsis, note that there's nothing more to execute.               * ellipsis, note that there's nothing more to execute.
              */               */
             if ((job->flags&JOB_FIRST) && (Lst_Open(&gn->commands) != SUCCESS)){              if ((job->flags&JOB_FIRST))
                 cmdsOK = FALSE;                  Lst_Open(&gn->commands);
             } else {              ln = Lst_Next(&gn->commands);
                 LstNode ln = Lst_Next(&gn->commands);  
   
                 if ((ln == NULL) || !JobPrintCommand(Lst_Datum(ln), job)) {              if ((ln == NULL) || !JobPrintCommand(Lst_Datum(ln), job)) {
                     noExec = TRUE;                  noExec = TRUE;
                     Lst_Close(&gn->commands);                  Lst_Close(&gn->commands);
                 }  
                 if (noExec && !(job->flags & JOB_FIRST)) {  
                     /*  
                      * If we're not going to execute anything, the job  
                      * is done and we need to close down the various  
                      * file descriptors we've opened for output, then  
                      * call JobDoOutput to catch the final characters or  
                      * send the file to the screen... Note that the i/o streams  
                      * are only open if this isn't the first job.  
                      * Note also that this could not be done in  
                      * Job_CatchChildren b/c it wasn't clear if there were  
                      * more commands to execute or not...  
                      */  
                     JobClose(job);  
                 }  
             }              }
               if (noExec && !(job->flags & JOB_FIRST)) {
                   /*
                    * If we're not going to execute anything, the job
                    * is done and we need to close down the various
                    * file descriptors we've opened for output, then
                    * call JobDoOutput to catch the final characters or
                    * send the file to the screen... Note that the i/o streams
                    * are only open if this isn't the first job.
                    * Note also that this could not be done in
                    * Job_CatchChildren b/c it wasn't clear if there were
                    * more commands to execute or not...
                    */
                   JobClose(job);
               }
         } else {          } else {
             /*              /*
              * We can do all the commands at once. hooray for sanity               * We can do all the commands at once. hooray for sanity
Line 2249 
Line 2248 
                 continue;                  continue;
             }              }
         } else {          } else {
             job = (Job *) Lst_Datum(jnode);              job = (Job *)Lst_Datum(jnode);
             Lst_Remove(&jobs, jnode);              Lst_Remove(&jobs, jnode);
             nJobs -= 1;              nJobs -= 1;
             if (jobFull && DEBUG(JOB)) {              if (jobFull && DEBUG(JOB)) {
Line 2341 
Line 2340 
             free(readfdsp);              free(readfdsp);
             return;              return;
         } else {          } else {
             if (Lst_Open(&jobs) == FAILURE) {              Lst_Open(&jobs);
                 free(readfdsp);  
                 Punt("Cannot open job table");  
             }  
             while (nfds && (ln = Lst_Next(&jobs)) != NULL) {              while (nfds && (ln = Lst_Next(&jobs)) != NULL) {
                 job = (Job *) Lst_Datum(ln);                  job = (Job *)Lst_Datum(ln);
                 if (FD_ISSET(job->inPipe, readfdsp)) {                  if (FD_ISSET(job->inPipe, readfdsp)) {
                     JobDoOutput(job, FALSE);                      JobDoOutput(job, FALSE);
                     nfds -= 1;                      nfds -= 1;
Line 2789 
Line 2785 
   
     aborting = ABORT_INTERRUPT;      aborting = ABORT_INTERRUPT;
   
    (void) Lst_Open(&jobs);      Lst_Open(&jobs);
     while ((ln = Lst_Next(&jobs)) != NULL) {      while ((ln = Lst_Next(&jobs)) != NULL) {
         job = (Job *) Lst_Datum(ln);          job = (Job *)Lst_Datum(ln);
   
         if (!Targ_Precious(job->node)) {          if (!Targ_Precious(job->node)) {
             char        *file = (job->node->path == NULL ?              char        *file = (job->node->path == NULL ?
Line 2834 
Line 2830 
     }      }
   
 #ifdef REMOTE  #ifdef REMOTE
    (void)Lst_Open(&stoppedJobs);      Lst_Open(&stoppedJobs);
     while ((ln = Lst_Next(&stoppedJobs)) != NULL) {      while ((ln = Lst_Next(&stoppedJobs)) != NULL) {
         job = (Job *) Lst_Datum(ln);          job = (Job *)Lst_Datum(ln);
   
         if (job->flags & JOB_RESTART) {          if (job->flags & JOB_RESTART) {
             if (DEBUG(JOB)) {              if (DEBUG(JOB)) {
Line 3013 
Line 3009 
   
     if (nJobs) {      if (nJobs) {
   
         (void) Lst_Open(&jobs);          Lst_Open(&jobs);
         while ((ln = Lst_Next(&jobs)) != NULL) {          while ((ln = Lst_Next(&jobs)) != NULL) {
             job = (Job *) Lst_Datum(ln);              job = (Job *)Lst_Datum(ln);
   
             /*              /*
              * kill the child process with increasingly drastic signals to make               * kill the child process with increasingly drastic signals to make
Line 3080 
Line 3076 
                     return;                      return;
                 }                  }
     }      }
     job = (Job *) Lst_Datum(jnode);      job = (Job *)Lst_Datum(jnode);
   
     if (DEBUG(JOB)) {      if (DEBUG(JOB)) {
         (void) fprintf(stdout,          (void) fprintf(stdout,

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30