[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.129 and 1.130

version 1.129, 2012/10/06 19:19:53 version 1.130, 2012/10/09 19:46:33
Line 205 
Line 205 
         } else if (errno == EPERM) {          } else if (errno == EPERM) {
                 kill_with_sudo_maybe(pid, signo, job->cmd);                  kill_with_sudo_maybe(pid, signo, job->cmd);
                 return "";                  return "";
         }          } else
                   return "should not happen";
 }  }
   
 static void  static void
Line 225 
Line 226 
 }  }
   
 static void  static void
 print_error(Job *j, Job *k)  print_error(Job *j)
 {  {
         const char *type;          static bool first = true;
   
         if (j->exit_type == JOB_EXIT_BAD) {          if (j->exit_type == JOB_EXIT_BAD) {
                 fprintf(stderr, "*** Error %d", j->code);                  fprintf(stderr, "*** Error %d", j->code);
Line 236 
Line 237 
                             sys_signame[j->sent_signal]);                              sys_signame[j->sent_signal]);
         } else if (j->exit_type == JOB_SIGNALED) {          } else if (j->exit_type == JOB_SIGNALED) {
                 if (j->code < NSIG)                  if (j->code < NSIG)
                         fprintf(stderr, "*** SIG%s",                          fprintf(stderr, "*** Signal SIG%s",
                             sys_signame[j->code]);                              sys_signame[j->code]);
                 else                  else
                         fprintf(stderr, "*** unknown signal %d", j->code);                          fprintf(stderr, "*** unknown signal %d", j->code);
Line 244 
Line 245 
                 fprintf(stderr, "*** Should not happen %d", j->code);                  fprintf(stderr, "*** Should not happen %d", j->code);
         if (DEBUG(KILL) && (j->flags & JOB_LOST))          if (DEBUG(KILL) && (j->flags & JOB_LOST))
                 fprintf(stderr, "!");                  fprintf(stderr, "!");
         fprintf(stderr, " (line %lu", j->location->lineno);          if (first) {
         if (j == k)                  fprintf(stderr, " in %s", Var_Value(".CURDIR"));
                 fprintf(stderr, " of %s,", j->location->fname);                  first = false;
         else          }
                 fputs(",", stderr);          fprintf(stderr, " (%s:%lu", j->location->fname, j->location->lineno);
           fprintf(stderr, " '%s'", j->node->name);
         if ((j->flags & (JOB_SILENT | JOB_IS_EXPENSIVE)) == JOB_SILENT)          if ((j->flags & (JOB_SILENT | JOB_IS_EXPENSIVE)) == JOB_SILENT)
                 fprintf(stderr, "\n     target '%s': %.150s%s", j->node->name,                  fprintf(stderr, ": %.120s%s", j->cmd,
                     j->cmd, strlen(j->cmd) > 150 ? "..." : "");                      strlen(j->cmd) > 120 ? "..." : "");
         else          fprintf(stderr, ")\n");
                 fprintf(stderr, " target '%s'", j->node->name);  
         fputs(")\n", stderr);  
         free(j->cmd);          free(j->cmd);
         may_remove_target(j);          may_remove_target(j);
 }  }
Line 264 
Line 264 
 {  {
         Job *j, *k, *jnext;          Job *j, *k, *jnext;
   
         fprintf(stderr, "\nStop in %s%c\n", Var_Value(".CURDIR"),          if (!errorJobs)
             errorJobs ? ':' : '.');                  fprintf(stderr, "Stop in %s.\n", Var_Value(".CURDIR"));
   
         while (errorJobs != NULL) {          while (errorJobs != NULL) {
                 k = errorJobs;                  k = errorJobs;
Line 273 
Line 273 
                 for (j = k; j != NULL; j = jnext) {                  for (j = k; j != NULL; j = jnext) {
                         jnext = j->next;                          jnext = j->next;
                         if (j->location->fname == k->location->fname)                          if (j->location->fname == k->location->fname)
                                 print_error(j, k);                                  print_error(j);
                         else {                          else {
                                 j->next = errorJobs;                                  j->next = errorJobs;
                                 errorJobs = j;                                  errorJobs = j;

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.130