Print this page
make: unifdef for two bugfixes conditioned for unknown reasons (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 ↓ 239 lines elided ↑ open up ↑
 240  240                          if ((commands[i][0] == (int) at_char) ||
 241  241                              (commands[i][0] == (int) hyphen_char)) {
 242  242                                  retmem_mb(commands[i]);
 243  243                          }
 244  244                  }
 245  245                  return res;
 246  246          }
 247  247  }
 248  248  
 249  249  
 250      -#define MAXJOBS_ADJUST_RFE4694000
 251      -
 252      -#ifdef MAXJOBS_ADJUST_RFE4694000
 253  250  
 254  251  #include <unistd.h>     /* sysconf(_SC_NPROCESSORS_ONLN) */
 255  252  #include <sys/ipc.h>            /* ftok() */
 256  253  #include <sys/shm.h>            /* shmget(), shmat(), shmdt(), shmctl() */
 257  254  #include <semaphore.h>          /* sem_init(), sem_trywait(), sem_post(), sem_destroy() */
 258  255  #include <sys/loadavg.h>        /* getloadavg() */
 259  256  
 260  257  /*
 261  258   *      adjust_pmake_max_jobs (int pmake_max_jobs)
 262  259   *
↓ open down ↓ 265 lines elided ↑ open up ↑
 528  525  
 529  526                  /* M2 specific initialization */
 530  527                  if (job_adjust_mode == ADJUST_M2) {
 531  528                          if (m2_init()) {
 532  529                                  job_adjust_error();
 533  530                          }
 534  531                  }
 535  532          }
 536  533  }
 537  534  
 538      -#endif /* MAXJOBS_ADJUST_RFE4694000 */
 539  535  
 540  536  /*
 541  537   *      distribute_process(char **commands, Property line)
 542  538   *
 543  539   *      Parameters:
 544  540   *              commands        argv vector of commands to execute
 545  541   *
 546  542   *      Return value:
 547  543   *                              The result of the execution
 548  544   *
 549  545   *      Static variables used:
 550  546   *              process_running Set to the pid of the process set running
 551      - * #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
 552  547   *              job_adjust_mode Current job adjust mode
 553      - * #endif
 554  548   */
 555  549  static Doname
 556  550  distribute_process(char **commands, Property line)
 557  551  {
 558  552          static unsigned file_number = 0;
 559  553          wchar_t         string[MAXPATHLEN];
 560  554          char            mbstring[MAXPATHLEN];
 561  555          int             filed;
 562  556          int             res;
 563  557          int             tmp_index;
 564  558          char            *tmp_index_str_ptr;
 565  559  
 566      -#if !defined (TEAMWARE_MAKE_CMN) || !defined (MAXJOBS_ADJUST_RFE4694000)
 567      -        while (parallel_process_cnt >= pmake_max_jobs) {
 568      -                await_parallel(false);
 569      -                finish_children(true);
 570      -        }
 571      -#else /* TEAMWARE_MAKE_CMN && MAXJOBS_ADJUST_RFE4694000 */
 572  560          /* initialize adjust mode, if not initialized */
 573  561          if (job_adjust_mode == ADJUST_UNKNOWN) {
 574  562                  job_adjust_init();
 575  563          }
 576  564  
 577  565          /* actions depend on adjust mode */
 578  566          switch (job_adjust_mode) {
 579  567          case ADJUST_M1:
 580  568                  while (parallel_process_cnt >= adjust_pmake_max_jobs (pmake_max_jobs)) {
 581  569                          await_parallel(false);
↓ open down ↓ 23 lines elided ↑ open up ↑
 605  593                                  finish_children(true);
 606  594                          }
 607  595                  }
 608  596                  break;
 609  597          default:
 610  598                  while (parallel_process_cnt >= pmake_max_jobs) {
 611  599                          await_parallel(false);
 612  600                          finish_children(true);
 613  601                  }
 614  602          }
 615      -#endif /* TEAMWARE_MAKE_CMN && MAXJOBS_ADJUST_RFE4694000 */
      603 +
 616  604          setvar_envvar();
 617  605          /*
 618  606           * Tell the user what DMake is doing.
 619  607           */
 620  608          if (!silent && output_mode != txt2_mode) {
 621  609                  /*
 622  610                   * Print local_host --> x job(s).
 623  611                   */
 624  612                  (void) fprintf(stdout,
 625  613                                 gettext("%s --> %d %s\n"),
↓ open down ↓ 519 lines elided ↑ open up ↑
1145 1133                          ;
1146 1134                  }
1147 1135                  if (rp == NULL) {
1148 1136                          fatal(gettext("Internal error: returned child pid not in running_list"));
1149 1137                  } else {
1150 1138                          rp->state = (WIFEXITED(status) && WEXITSTATUS(status) == 0) ? build_ok : build_failed;
1151 1139                  }
1152 1140                  nohang = true;
1153 1141                  parallel_process_cnt--;
1154 1142  
1155      -#if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
1156 1143                  if (job_adjust_mode == ADJUST_M2) {
1157 1144                          if (m2_release_job()) {
1158 1145                                  job_adjust_error();
1159 1146                          }
1160 1147                  }
1161      -#endif
1162 1148          }
1163 1149  }
1164 1150  
1165 1151  /*
1166 1152   *      finish_children(docheck)
1167 1153   *
1168 1154   *      Finishes the processing for all targets which were running
1169 1155   *      and have now completed.
1170 1156   *
1171 1157   *      Parameters:
↓ open down ↓ 735 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX