[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.24 and 1.25

version 1.24, 2000/03/26 16:08:27 version 1.25, 2000/03/26 16:21:32
Line 384 
Line 384 
         (void) fprintf(stdout, "JobPassSig(%d) called.\n", signo);          (void) fprintf(stdout, "JobPassSig(%d) called.\n", signo);
         (void) fflush(stdout);          (void) fflush(stdout);
     }      }
     Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);      Lst_ForEach(jobs, JobCondPassSig, &signo);
   
     /*      /*
      * Deal with proper cleanup based on the signal received. We only run       * Deal with proper cleanup based on the signal received. We only run
Line 430 
Line 430 
     (void) KILL(getpid(), signo);      (void) KILL(getpid(), signo);
   
     signo = SIGCONT;      signo = SIGCONT;
     Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);      Lst_ForEach(jobs, JobCondPassSig, &signo);
   
     (void) sigprocmask(SIG_SETMASK, &omask, NULL);      (void) sigprocmask(SIG_SETMASK, &omask, NULL);
     sigprocmask(SIG_SETMASK, &omask, NULL);      sigprocmask(SIG_SETMASK, &omask, NULL);
Line 536 
Line 536 
         job->node->type |= OP_SAVE_CMDS;          job->node->type |= OP_SAVE_CMDS;
         if ((job->flags & JOB_IGNDOTS) == 0) {          if ((job->flags & JOB_IGNDOTS) == 0) {
             job->tailCmds = Lst_Succ(Lst_Member(job->node->commands,              job->tailCmds = Lst_Succ(Lst_Member(job->node->commands,
                                                 (ClientData)cmd));                                                  cmd));
             return 1;              return 1;
         }          }
         return 0;          return 0;
Line 555 
Line 555 
      * For debugging, we replace each command with the result of expanding       * For debugging, we replace each command with the result of expanding
      * the variables in the command.       * the variables in the command.
      */       */
     cmdNode = Lst_Member(job->node->commands, (ClientData)cmd);      cmdNode = Lst_Member(job->node->commands, cmd);
     cmdStart = cmd = Var_Subst(cmd, job->node, FALSE);      cmdStart = cmd = Var_Subst(cmd, job->node, FALSE);
     Lst_Replace(cmdNode, (ClientData)cmdStart);      Lst_Replace(cmdNode, cmdStart);
   
     cmdTemplate = "%s\n";      cmdTemplate = "%s\n";
   
Line 854 
Line 854 
                     WSTOPSIG(*status));                      WSTOPSIG(*status));
             }              }
             job->flags |= JOB_RESUME;              job->flags |= JOB_RESUME;
             Lst_AtEnd(stoppedJobs, (ClientData)job);              Lst_AtEnd(stoppedJobs, job);
 #ifdef REMOTE  #ifdef REMOTE
             if (job->flags & JOB_REMIGRATE)              if (job->flags & JOB_REMIGRATE)
                 JobRestart(job);                  JobRestart(job);
Line 892 
Line 892 
 #endif  #endif
             }              }
             job->flags &= ~JOB_CONTINUING;              job->flags &= ~JOB_CONTINUING;
             Lst_AtEnd(jobs, (ClientData)job);              Lst_AtEnd(jobs, job);
             nJobs += 1;              nJobs += 1;
             if (!(job->flags & JOB_REMOTE)) {              if (!(job->flags & JOB_REMOTE)) {
                 if (DEBUG(JOB)) {                  if (DEBUG(JOB)) {
Line 968 
Line 968 
         if (job->tailCmds != NULL) {          if (job->tailCmds != NULL) {
             Lst_ForEachFrom(job->node->commands, job->tailCmds,              Lst_ForEachFrom(job->node->commands, job->tailCmds,
                              JobSaveCommand,                               JobSaveCommand,
                             (ClientData)job->node);                              job->node);
         }          }
         job->node->made = MADE;          job->node->made = MADE;
         Make_Update(job->node);          Make_Update(job->node);
Line 1335 
Line 1335 
      * Now the job is actually running, add it to the table.       * Now the job is actually running, add it to the table.
      */       */
     nJobs += 1;      nJobs += 1;
     Lst_AtEnd(jobs, (ClientData)job);      Lst_AtEnd(jobs, job);
     if (nJobs == maxJobs) {      if (nJobs == maxJobs) {
         jobFull = TRUE;          jobFull = TRUE;
     }      }
Line 1470 
Line 1470 
                    (void) fprintf(stdout, "*** holding\n");                     (void) fprintf(stdout, "*** holding\n");
                    (void) fflush(stdout);                     (void) fflush(stdout);
                 }                  }
                 Lst_AtFront(stoppedJobs, (ClientData)job);                  Lst_AtFront(stoppedJobs, job);
                 jobFull = TRUE;                  jobFull = TRUE;
                 if (DEBUG(JOB)) {                  if (DEBUG(JOB)) {
                    (void) fprintf(stdout, "Job queue is full.\n");                     (void) fprintf(stdout, "Job queue is full.\n");
Line 1491 
Line 1491 
         }          }
 #endif  #endif
   
         Lst_AtEnd(jobs, (ClientData)job);          Lst_AtEnd(jobs, job);
         nJobs += 1;          nJobs += 1;
         if (nJobs == maxJobs) {          if (nJobs == maxJobs) {
             jobFull = TRUE;              jobFull = TRUE;
Line 1536 
Line 1536 
                     (void) fprintf(stdout, "holding\n");                      (void) fprintf(stdout, "holding\n");
                     (void) fflush(stdout);                      (void) fflush(stdout);
                 }                  }
                 Lst_AtFront(stoppedJobs, (ClientData)job);                  Lst_AtFront(stoppedJobs, job);
                 jobFull = TRUE;                  jobFull = TRUE;
                 if (DEBUG(JOB)) {                  if (DEBUG(JOB)) {
                     (void) fprintf(stdout, "Job queue is full.\n");                      (void) fprintf(stdout, "Job queue is full.\n");
Line 1635 
Line 1635 
                 (void) fprintf(stdout, "table full\n");                  (void) fprintf(stdout, "table full\n");
                 (void) fflush(stdout);                  (void) fflush(stdout);
             }              }
             Lst_AtFront(stoppedJobs, (ClientData)job);              Lst_AtFront(stoppedJobs, job);
             jobFull = TRUE;              jobFull = TRUE;
             if (DEBUG(JOB)) {              if (DEBUG(JOB)) {
                 (void) fprintf(stdout, "Job queue is full.\n");                  (void) fprintf(stdout, "Job queue is full.\n");
Line 1764 
Line 1764 
                 LstNode ln = Lst_Next(gn->commands);                  LstNode ln = Lst_Next(gn->commands);
   
                 if ((ln == NULL) ||                  if ((ln == NULL) ||
                     JobPrintCommand((ClientData) Lst_Datum(ln),                      JobPrintCommand(Lst_Datum(ln), job))
                                     (ClientData) job))  
                 {                  {
                     noExec = TRUE;                      noExec = TRUE;
                     Lst_Close(gn->commands);                      Lst_Close(gn->commands);
Line 1790 
Line 1789 
              * We can do all the commands at once. hooray for sanity               * We can do all the commands at once. hooray for sanity
              */               */
             numCommands = 0;              numCommands = 0;
             Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);              Lst_ForEach(gn->commands, JobPrintCommand, job);
   
             /*              /*
              * If we didn't print out any commands to the shell script,               * If we didn't print out any commands to the shell script,
Line 1816 
Line 1815 
          * doesn't do any harm in this case and may do some good.           * doesn't do any harm in this case and may do some good.
          */           */
         if (cmdsOK) {          if (cmdsOK) {
             Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);              Lst_ForEach(gn->commands, JobPrintCommand, job);
         }          }
         /*          /*
          * Don't execute the shell, thank you.           * Don't execute the shell, thank you.
Line 1857 
Line 1856 
                 if (job->tailCmds != NULL) {                  if (job->tailCmds != NULL) {
                     Lst_ForEachFrom(job->node->commands, job->tailCmds,                      Lst_ForEachFrom(job->node->commands, job->tailCmds,
                                     JobSaveCommand,                                      JobSaveCommand,
                                    (ClientData)job->node);                                     job->node);
                 }                  }
                 Make_Update(job->node);                  Make_Update(job->node);
             }              }
Line 1940 
Line 1939 
            (void) fflush(stdout);             (void) fflush(stdout);
         }          }
         job->flags |= JOB_RESTART;          job->flags |= JOB_RESTART;
         Lst_AtEnd(stoppedJobs, (ClientData)job);          Lst_AtEnd(stoppedJobs, job);
     } else {      } else {
         if ((nLocal >= maxLocal) && local) {          if ((nLocal >= maxLocal) && local) {
             /*              /*
Line 2252 
Line 2251 
         }          }
   
   
         jnode = Lst_Find(jobs, JobCmpPid, (ClientData)&pid);          jnode = Lst_Find(jobs, JobCmpPid, &pid);
   
         if (jnode == NULL) {          if (jnode == NULL) {
             if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {              if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {
                 jnode = Lst_Find(stoppedJobs, JobCmpPid, (ClientData)&pid);                  jnode = Lst_Find(stoppedJobs, JobCmpPid, &pid);
                 if (jnode == NULL) {                  if (jnode == NULL) {
                     Error("Resumed child (%d) not in table", pid);                      Error("Resumed child (%d) not in table", pid);
                     continue;                      continue;
Line 3088 
Line 3087 
         (void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);          (void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
         (void) fflush(stdout);          (void) fflush(stdout);
     }      }
     jnode = Lst_Find(jobs, JobCmpRmtID, (ClientData)&hostID);      jnode = Lst_Find(jobs, JobCmpRmtID, &hostID);
   
     if (jnode == NULL) {      if (jnode == NULL) {
         jnode = Lst_Find(stoppedJobs, JobCmpRmtID, (ClientData)&hostID);          jnode = Lst_Find(stoppedJobs, JobCmpRmtID, &hostID);
                 if (jnode == NULL) {                  if (jnode == NULL) {
                     if (DEBUG(JOB)) {                      if (DEBUG(JOB)) {
                         Error("Evicting host(%d) not in table", hostID);                          Error("Evicting host(%d) not in table", hostID);

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25