Print this page
5910 libnisdb won't build with modern GCC

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/yptol/lock_update.c
          +++ new/usr/src/lib/libnisdb/yptol/lock_update.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2015 Gary Mills
  23   24   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   */
  26   27  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   28  /*
  30   29   * DESCRIPTION: Contains code supporting the 'update in progress' flag. This is
  31   30   *              a near copy of lock flag code (in
  32   31   *              usr/src/cmd/ypcmd/shared/lockmp.c) If we implement a clean
  33   32   *              version of the locking code this file will probably disappear.
  34   33   *
  35   34   *              These locks are held while a map is being updated from the
  36   35   *              DIT. They prevent a second update being started while this is
  37   36   *              in progress. This is independant from the `lockmap` mechanism
  38   37   *              which protects maps, generally for a much shorter period,
↓ open down ↓ 30 lines elided ↑ open up ↑
  69   68  bool_t
  70   69  init_update_locks_mem()
  71   70  {
  72   71          int iiter, rc;
  73   72          int ebusy_cnt = 0;
  74   73  
  75   74          /*
  76   75           * Initialize cross-process locks in memory-mapped file.
  77   76           */
  78   77          for (iiter = 0; iiter < MAXHASH; iiter++) {
  79      -                if (rc = mutex_init(&(shmupdatearray->updatenode[iiter]),
  80      -                    USYNC_PROCESS | LOCK_ROBUST, 0)) {
       78 +                if ((rc = mutex_init(&(shmupdatearray->updatenode[iiter]),
       79 +                    USYNC_PROCESS | LOCK_ROBUST, 0)) != 0) {
  81   80                          if (rc == EBUSY) {
  82   81                                  ebusy_cnt++;
  83   82                          } else {
  84   83                                  logmsg(MSG_NOTIMECHECK, LOG_ERR,
  85   84                                          "init_update_locks_mem():mutex_init():"
  86   85                                          "error=%d", rc);
  87   86                                  return (FALSE);
  88   87                          }
  89   88                  }
  90   89          }
↓ open down ↓ 311 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX