Print this page
make: unifdef for REDIRECT_ERR (defined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/parallel.cc
          +++ new/usr/src/cmd/make/bin/parallel.cc
↓ open down ↓ 841 lines elided ↑ open up ↑
 842  842          (void) sprintf(mbstring,
 843  843                          NOCATGETS("%s/dmake.stdout.%d.%d.XXXXXX"),
 844  844                          tmpdir,
 845  845                          getpid(),
 846  846                          file_number++);
 847  847  
 848  848          mktemp(mbstring);
 849  849  
 850  850          stdout_file = strdup(mbstring);
 851  851          stderr_file = NULL;
 852      -#if defined (TEAMWARE_MAKE_CMN) && defined(REDIRECT_ERR)
      852 +#if defined (TEAMWARE_MAKE_CMN)
 853  853          if (!out_err_same) {
 854  854                  (void) sprintf(mbstring,
 855  855                                  NOCATGETS("%s/dmake.stderr.%d.%d.XXXXXX"),
 856  856                                  tmpdir,
 857  857                                  getpid(),
 858  858                                  file_number++);
 859  859  
 860  860                  mktemp(mbstring);
 861  861  
 862  862                  stderr_file = strdup(mbstring);
↓ open down ↓ 599 lines elided ↑ open up ↑
1462 1462                                                  }
1463 1463                                                  if (out_buf.st_size != cmds_length || silent_flag ||
1464 1464                                                      output_mode == txt2_mode) {
1465 1465                                                          dump_out_file(rp->stdout_file, false);
1466 1466                                                  }
1467 1467                                          }
1468 1468                                          (void) unlink(rp->stdout_file);
1469 1469                                          retmem_mb(rp->stdout_file);
1470 1470                                          rp->stdout_file = NULL;
1471 1471                                  }
1472      -#if defined(REDIRECT_ERR)
     1472 +
1473 1473                                  if (!out_err_same && (rp->stderr_file != NULL)) {
1474 1474                                          if (stat(rp->stderr_file, &out_buf) < 0) {
1475 1475                                                  fatal(catgets(catd, 1, 130, "stat of %s failed: %s"),
1476 1476                                                        rp->stderr_file,
1477 1477                                                        errmsg(errno));
1478 1478                                          }
1479 1479                                          if ((line2 != NULL) &&
1480 1480                                              (out_buf.st_size > 0)) {
1481 1481                                                  dump_out_file(rp->stderr_file, true);
1482 1482                                          }
1483 1483                                          (void) unlink(rp->stderr_file);
1484 1484                                          retmem_mb(rp->stderr_file);
1485 1485                                          rp->stderr_file = NULL;
1486 1486                                  }
1487      -#endif
1488 1487                          }
1489 1488                          check_state(rp->temp_file);
1490 1489                          if (rp->temp_file != NULL) {
1491 1490                                  free_name(rp->temp_file);
1492 1491                          }
1493 1492                          rp->temp_file = NULL;
1494 1493                          if (rp->state == build_failed) {
1495 1494                                  line = get_prop(rp->target->prop, line_prop);
1496 1495                                  if (line != NULL) {
1497 1496                                          line->body.line.command_used = NULL;
↓ open down ↓ 529 lines elided ↑ open up ↑
2027 2026  
2028 2027          childPid = fork();
2029 2028          switch (childPid) {
2030 2029          case -1:        /* Error */
2031 2030                  fatal(catgets(catd, 1, 337, "Could not fork child process for dmake job: %s"),
2032 2031                        errmsg(errno));
2033 2032                  break;
2034 2033          case 0:         /* Child */
2035 2034                  /* To control the processed targets list is not the child's business */
2036 2035                  running_list = NULL;
2037      -#if defined(REDIRECT_ERR)
2038 2036                  if(out_err_same) {
2039 2037                          redirect_io(stdout_file, (char*)NULL);
2040 2038                  } else {
2041 2039                          redirect_io(stdout_file, stderr_file);
2042 2040                  }
2043      -#else
2044      -                redirect_io(stdout_file, (char*)NULL);
2045      -#endif
2046 2041                  for (commands = commands;
2047 2042                       (*commands != (char *)NULL);
2048 2043                       commands++) {
2049 2044                          silent_flag = silent;
2050 2045                          ignore = false;
2051 2046                          always_exec = false;
2052 2047                          while ((**commands == (int) at_char) ||
2053 2048                                 (**commands == (int) hyphen_char) ||
2054 2049                                 (**commands == (int) plus_char)) {
2055 2050                                  if (**commands == (int) at_char) {
↓ open down ↓ 148 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX