Changeset 3432 in kBuild
- Timestamp:
- Sep 1, 2020 1:17:57 PM (5 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/job.c
r3312 r3432 1062 1062 #ifndef NO_OUTPUT_SYNC 1063 1063 /* Synchronize any remaining parallel output. */ 1064 # ifdef KMK 1065 c->output.dont_truncate = !err && child_failed && !dontcare && !keep_going_flag && !handling_fatal_signal; 1066 # endif 1064 1067 output_dump (&c->output); 1065 1068 #endif … … 1096 1099 lastc->next = c->next; 1097 1100 1101 #ifdef KMK /* Repeat the error */ 1102 /* If the job failed, and the -k flag was not given, die, 1103 unless we are already in the process of dying. */ 1104 if (!err && child_failed && !dontcare && !keep_going_flag && 1105 /* fatal_error_signal will die with the right signal. */ 1106 !handling_fatal_signal) 1107 { 1108 unblock_sigs (); 1109 die_with_job_output (child_failed, &c->output); 1110 } 1111 #endif 1112 1098 1113 free_child (c); 1099 1114 1100 1115 unblock_sigs (); 1101 1116 1117 #ifndef KMK /* See above. */ 1102 1118 /* If the job failed, and the -k flag was not given, die, 1103 1119 unless we are already in the process of dying. */ … … 1106 1122 !handling_fatal_signal) 1107 1123 die (child_failed); 1124 #endif 1108 1125 1109 1126 /* Only block for one child. */ -
trunk/src/kmk/main.c
r3396 r3432 4359 4359 4360 4360 void 4361 #ifdef KMK 4362 die_with_job_output (int status, struct output *out) 4363 #else 4361 4364 die (int status) 4365 #endif 4362 4366 { 4363 4367 static char dying = 0; 4364 4368 #ifdef KMK 4365 4369 static char need_2nd_error = 0; 4370 static char need_2nd_error_output = 0; 4366 4371 #endif 4367 4372 … … 4381 4386 || print_data_base_flag 4382 4387 || print_stats_flag)) 4383 need_2nd_error = 1; 4388 { 4389 need_2nd_error = 1; 4390 need_2nd_error_output = job_slots_used > 2 4391 && out == NULL 4392 && out != &make_sync; 4393 } 4384 4394 #endif /* KMK */ 4385 4395 … … 4457 4467 if (need_2nd_error != 0) 4458 4468 ON (error, NILF, _("*** Exiting with status %d"), status); 4469 if (out) 4470 { 4471 out->dont_truncate = 0; 4472 if (need_2nd_error_output) 4473 output_dump (out); 4474 output_close (out); 4475 } 4459 4476 #endif 4460 4477 4461 4478 exit (status); 4462 4479 } 4480 4481 #ifdef KMK 4482 void die(int status) 4483 { 4484 die_with_job_output (status, NULL); 4485 } 4486 #endif -
trunk/src/kmk/makeint.h
r3389 r3432 663 663 664 664 void die (int) __attribute__ ((noreturn)); 665 void die_with_job_output (int, struct output *) __attribute__ ((noreturn)); 665 666 void pfatal_with_name (const char *) __attribute__ ((noreturn)); 666 667 void perror_with_name (const char *, const char *); -
trunk/src/kmk/output.c
r3289 r3432 172 172 release_semaphore (sem); 173 173 174 # ifdef KMK 175 if (!out->dont_truncate) 176 { /* likely */ } 177 else return; 178 # endif 179 174 180 /* Free the segments and reset the state. */ 175 181 while ((seg = out->out.head_seg)) … … 926 932 release_semaphore (sem); 927 933 934 # ifdef KMK 935 if (!out->dont_truncate) 936 { /* likely */ } 937 else return; 938 # endif 928 939 /* Truncate and reset the output, in case we use it again. */ 929 940 if (out->out != OUTPUT_NONE) … … 1068 1079 #endif 1069 1080 out->syncout = !!output_sync; 1081 #ifdef KMK 1082 out->dont_truncate = 0; 1083 #endif 1070 1084 return; 1071 1085 } -
trunk/src/kmk/output.h
r3244 r3432 60 60 #endif 61 61 unsigned int syncout:1; /* True if we want to synchronize output. */ 62 #ifdef KMK 63 unsigned int dont_truncate:1; /* For die_with_child_output repeat. */ 64 #endif 62 65 }; 63 66
Note:
See TracChangeset
for help on using the changeset viewer.