Print this page
make: unifdef for NSE (undefined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/state.cc
          +++ new/usr/src/cmd/make/bin/state.cc
↓ open down ↓ 110 lines elided ↑ open up ↑
 111  111   *              do_not_exec_rule If -n is on we do not write statefile
 112  112   *              hashtab         The hashtable that contains all names
 113  113   *              keep_state      If .KEEP_STATE is no on we do not write file
 114  114   *              make_state      The Name ".make.state", used for opening file
 115  115   *              make_version    The Name ".MAKE_VERSION", written
 116  116   *              recursive_name  The Name ".RECURSIVE", written
 117  117   *              rewrite_statefile Indicates that something changed
 118  118   */
 119  119  
 120  120  void
 121      -#ifdef NSE
 122      -write_state_file(int report_recursive, Boolean exiting)
 123      -#else
 124  121  write_state_file(int, Boolean exiting)
 125      -#endif
 126  122  {
 127  123          register FILE           *fd;
 128  124          int                     lock_err;
 129  125          char                    buffer[MAXPATHLEN];
 130  126          char                    make_state_tempfile[MAXPATHLEN];
 131  127          jmp_buf                 long_jump;
 132  128          register int            attempts = 0;
 133  129          Name_set::iterator      np, e;
 134  130          register Property       lines;
 135  131          register int            m;
↓ open down ↓ 55 lines elided ↑ open up ↑
 191  187          if ((fd = fopen(make_state_tempfile, "w")) == NULL) {
 192  188                  lock_err = errno; /* Save it! unlink() can change errno */
 193  189                  (void) unlink(make_state_lockfile);
 194  190                  retmem_mb(make_state_lockfile);
 195  191                  make_state_lockfile = NULL;
 196  192                  make_state_locked = false;
 197  193                  fatal(catgets(catd, 1, 59, "Could not open temporary statefile `%s': %s"),
 198  194                        make_state_tempfile,
 199  195                        errmsg(lock_err));
 200  196          }
 201      -#ifdef NSE
 202      -        if (nse) {
 203      -                (void) fchmod(fileno(fd), 0666); 
 204      -        }
 205      -#endif
 206  197          /*
 207  198           * Set a trap for failed writes. If a write fails, the routine
 208  199           * will try saving the .make.state file under another name in /tmp.
 209  200           */
 210  201          if (setjmp(long_jump)) {
 211  202                  (void) fclose(fd);
 212  203                  if (attempts++ > 5) {
 213  204                          if ((make_state_lockfile != NULL) &&
 214  205                              make_state_locked) {
 215  206                                  (void) unlink(make_state_lockfile);
↓ open down ↓ 175 lines elided ↑ open up ↑
 391  382                                make_state->string_mb,
 392  383                                errmsg(lock_err));
 393  384                  }
 394  385          }
 395  386          if ((make_state_lockfile != NULL) && make_state_locked) {
 396  387                  (void) unlink(make_state_lockfile);
 397  388                  retmem_mb(make_state_lockfile);
 398  389                  make_state_lockfile = NULL;
 399  390                  make_state_locked = false;
 400  391          }
 401      -#ifdef NSE
 402      -        if (report_recursive) {
 403      -                report_recursive_done();
 404      -        }
 405      -#endif
 406  392  }
 407  393  
 408  394  /*
 409  395   *      print_auto_depes(dependency, fd, built_this_run,
 410  396   *                       line_length, target_name, long_jump)
 411  397   *
 412  398   *      Will print a dependency list for automatic entries.
 413  399   *
 414  400   *      Parameters:
 415  401   *              dependency      The dependency to print
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX