[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.154 and 1.155

version 1.154, 2020/01/13 15:24:31 version 1.155, 2020/01/13 15:41:53
Line 70 
Line 70 
  *   *
  *      Job_Init                Called to initialize this module.   *      Job_Init                Called to initialize this module.
  *   *
  *      Job_Begin               execute commands attached to the .BEGIN target  
  *                              if any.  
  *  
  *      can_start_job           Return true if we can start job   *      can_start_job           Return true if we can start job
  *   *
  *      Job_Empty               Return true if the job table is completely   *      Job_Empty               Return true if the job table is completely
  *                              empty.   *                              empty.
  *   *
  *      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.  
  *  
  *      Job_AbortAll            Abort all current jobs. It doesn't   *      Job_AbortAll            Abort all current jobs. It doesn't
  *                              handle output or do anything for the jobs,   *                              handle output or do anything for the jobs,
  *                              just kills them.   *                              just kills them.
Line 113 
Line 105 
 #include "lst.h"  #include "lst.h"
 #include "gnode.h"  #include "gnode.h"
 #include "memory.h"  #include "memory.h"
 #include "make.h"  
 #include "buf.h"  #include "buf.h"
   #include "enginechoice.h"
   
 static int      aborting = 0;       /* why is the make aborting? */  static int      aborting = 0;       /* why is the make aborting? */
 #define ABORT_ERROR     1           /* Because of an error */  #define ABORT_ERROR     1           /* Because of an error */
Line 131 
Line 123 
 static Job *heldJobs;           /* Jobs not running yet because of expensive */  static Job *heldJobs;           /* Jobs not running yet because of expensive */
 static pid_t mypid;             /* Used for printing debugging messages */  static pid_t mypid;             /* Used for printing debugging messages */
 static Job *extra_job;          /* Needed for .INTERRUPT */  static Job *extra_job;          /* Needed for .INTERRUPT */
 static bool compatMode;         /* If we're running with compat.c don't call Make_Update */  
   
 static volatile sig_atomic_t got_fatal;  static volatile sig_atomic_t got_fatal;
   
Line 540 
Line 531 
                  * non-zero status that we shouldn't ignore, we call                   * non-zero status that we shouldn't ignore, we call
                  * Make_Update to update the parents. */                   * Make_Update to update the parents. */
                 job->node->built_status = REBUILT;                  job->node->built_status = REBUILT;
                 if (!compatMode)                  engine_node_updated(job->node);
                         Make_Update(job->node);  
         }          }
         if (job->flags & JOB_KEEPERROR) {          if (job->flags & JOB_KEEPERROR) {
                 job->next = errorJobs;                  job->next = errorJobs;
Line 823 
Line 813 
 }  }
   
 void  void
 Job_Init(int maxJobs, bool compat)  Job_Init(int maxJobs)
 {  {
         Job *j;          Job *j;
         int i;          int i;
Line 833 
Line 823 
         errorJobs = NULL;          errorJobs = NULL;
         availableJobs = NULL;          availableJobs = NULL;
         sequential = maxJobs == 1;          sequential = maxJobs == 1;
         compatMode = compat;  
   
         /* we allocate n+1 jobs, since we may need an extra job for          /* we allocate n+1 jobs, since we may need an extra job for
          * running .INTERRUPT.  */           * running .INTERRUPT.  */
Line 908 
Line 897 
         /*NOTREACHED*/          /*NOTREACHED*/
         fprintf(stderr, "This should never happen\n");          fprintf(stderr, "This should never happen\n");
         exit(1);          exit(1);
 }  
   
 /*  
  *-----------------------------------------------------------------------  
  * Job_Finish --  
  *      Do final processing such as the running of the commands  
  *      attached to the .END target.  
  *  
  *      return true if fatal errors have happened.  
  *-----------------------------------------------------------------------  
  */  
 bool  
 Job_Finish(void)  
 {  
         bool problem = errorJobs != NULL;  
   
         if ((end_node->type & OP_DUMMY) == 0) {  
                 if (problem) {  
                         Error("Errors reported so .END ignored");  
                 } else {  
                         Job_Make(end_node);  
                         loop_handle_running_jobs();  
                 }  
         }  
         return problem;  
 }  
   
 void  
 Job_Begin(void)  
 {  
         if ((begin_node->type & OP_DUMMY) == 0) {  
                 Job_Make(begin_node);  
                 loop_handle_running_jobs();  
         }  
 }  }
   
 /*-  /*-

Legend:
Removed from v.1.154  
changed lines
  Added in v.1.155