Print this page
make: unifdef for other OSes (undefined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/lib/vroot/lock.cc
          +++ new/usr/src/cmd/make/lib/vroot/lock.cc
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  #include <sys/errno.h>
  31   31  #include <sys/param.h>
  32   32  #include <sys/stat.h>
  33   33  #include <sys/types.h>
  34   34  #include <unistd.h>
  35   35  #include <vroot/vroot.h>
  36   36  #include <mksdmsi18n/mksdmsi18n.h>
  37   37  #include <signal.h>
  38   38  #include <errno.h>                      /* errno */
  39   39  
  40      -#if !defined(linux)
  41   40  extern  char            *sys_errlist[];
  42   41  extern  int             sys_nerr;
  43      -#endif
  44   42  
  45   43  static  void            file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
  46   44  
  47   45  #define BLOCK_INTERUPTS sigfillset(&newset) ; \
  48   46          sigprocmask(SIG_SETMASK, &newset, &oldset)
  49   47  
  50   48  #define UNBLOCK_INTERUPTS \
  51   49          sigprocmask(SIG_SETMASK, &oldset, &newset)
  52   50  
  53   51  /*
↓ open down ↓ 107 lines elided ↑ open up ↑
 161  159   */
 162  160  static  void
 163  161  file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
 164  162  {
 165  163          int             len;
 166  164  
 167  165          sprintf(msg, catgets(libmksdmsi18n_catd, 1, 145, "Could not lock file `%s'; "), file);
 168  166          len = strlen(msg);
 169  167          sprintf(&msg[len], str, arg1, arg2);
 170  168          strcat(msg, catgets(libmksdmsi18n_catd, 1, 146, " failed - "));
 171      -#if !defined(linux)
 172  169          if (errno < sys_nerr) {
 173      -#ifdef SUN4_x
 174      -                strcat(msg, sys_errlist[errno]);
 175      -#endif
 176  170                  strcat(msg, strerror(errno));
 177  171          } else {
 178  172                  len = strlen(msg);
 179  173                  sprintf(&msg[len], NOCATGETS("errno %d"), errno);
 180  174          }
 181      -#else
 182      -        strcat(msg, strerror(errno));
 183      -#endif
 184  175  }
 185  176  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX