Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c
          +++ new/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_persist.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  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   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2018 Joyent, Inc.
  24   25   * Copyright 2016 Argo Technologie SA.
  25   26   * Copyright (c) 2016-2017, Chris Fraire <cfraire@me.com>.
  26   27   */
  27   28  
  28   29  /*
  29   30   * Contains DB walker functions, which are of type `db_wfunc_t';
  30   31   *
  31   32   * typedef boolean_t db_wfunc_t(void *cbarg, nvlist_t *db_nvl, char *buf,
  32   33   *                              size_t bufsize, int *errp);
  33   34   *
↓ open down ↓ 416 lines elided ↑ open up ↑
 450  451           * writeop(i.e., we have acquired the write lock above).
 451  452           */
 452  453          if (access(IPADM_VOL_DB_FILE, F_OK) != 0) {
 453  454                  assert(writeop);
 454  455                  err = ipmgmt_cpfile(IPADM_DB_FILE, IPADM_VOL_DB_FILE, B_TRUE);
 455  456                  if (err != 0)
 456  457                          goto done;
 457  458                  (void) pthread_attr_init(&attr);
 458  459                  (void) pthread_attr_setdetachstate(&attr,
 459  460                      PTHREAD_CREATE_DETACHED);
      461 +                (void) pthread_attr_setname_np(&attr, "db_restore");
 460  462                  err = pthread_create(&tid, &attr, ipmgmt_db_restore_thread,
 461  463                      NULL);
 462  464                  (void) pthread_attr_destroy(&attr);
 463  465                  if (err != 0) {
 464  466                          (void) unlink(IPADM_VOL_DB_FILE);
 465  467                          goto done;
 466  468                  }
 467  469                  ipmgmt_rdonly_root = B_TRUE;
 468  470          }
 469  471  
↓ open down ↓ 647 lines elided ↑ open up ↑
1117 1119   * we do this in very early stage of daemon coming up, even before the door
1118 1120   * is opened.
1119 1121   */
1120 1122  /* ARGSUSED */
1121 1123  extern boolean_t
1122 1124  ipmgmt_aobjmap_init(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
1123 1125      int *errp)
1124 1126  {
1125 1127          nvpair_t                *nvp = NULL;
1126 1128          char                    *name, *strval = NULL;
1127      -        ipmgmt_aobjmap_t        node;
     1129 +        ipmgmt_aobjmap_t        node;
1128 1130          struct sockaddr_in6     *in6;
1129 1131  
1130 1132          *errp = 0;
1131 1133          node.am_next = NULL;
1132 1134          for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
1133 1135              nvp = nvlist_next_nvpair(db_nvl, nvp)) {
1134 1136                  name = nvpair_name(nvp);
1135 1137  
1136 1138                  if ((*errp = nvpair_value_string(nvp, &strval)) != 0)
1137 1139                          return (B_TRUE);
↓ open down ↓ 570 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX