Print this page
12071 clarify implementation of single_instance in SMF services
Reviewed by: Robert Mustacchi <rm@fingolfin.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/svccfg/svccfg_libscf.c
          +++ new/usr/src/cmd/svc/svccfg/svccfg_libscf.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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2015 Joyent, Inc.
       24 + * Copyright 2019 Joyent, Inc.
  25   25   * Copyright 2012 Milan Jurik. All rights reserved.
  26   26   * Copyright 2017 RackTop Systems.
  27   27   * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  28   28   */
  29   29  
  30   30  
  31   31  #include <alloca.h>
  32   32  #include <assert.h>
  33   33  #include <ctype.h>
  34   34  #include <door.h>
↓ open down ↓ 9701 lines elided ↑ open up ↑
9736 9736  
9737 9737          /* Walk the properties, looking for special ones. */
9738 9738          if (scf_iter_pg_properties(exp_prop_iter, pg) != SCF_SUCCESS)
9739 9739                  scfdie();
9740 9740  
9741 9741          while ((ret = scf_iter_next_property(exp_prop_iter, exp_prop)) == 1) {
9742 9742                  if (scf_property_get_name(exp_prop, exp_str, exp_str_sz) < 0)
9743 9743                          scfdie();
9744 9744  
9745 9745                  if (strcmp(exp_str, SCF_PROPERTY_SINGLE_INSTANCE) == 0) {
     9746 +                        /*
     9747 +                         * Unimplemented and obsolete, but we still process it
     9748 +                         * for compatibility purposes.
     9749 +                         */
9746 9750                          if (prop_check_type(exp_prop, SCF_TYPE_BOOLEAN) == 0 &&
9747 9751                              prop_get_val(exp_prop, exp_val) == 0) {
9748 9752                                  uint8_t b;
9749 9753  
9750 9754                                  if (scf_value_get_boolean(exp_val, &b) !=
9751 9755                                      SCF_SUCCESS)
9752 9756                                          scfdie();
9753 9757  
9754 9758                                  if (b) {
9755 9759                                          selts->single_instance =
↓ open down ↓ 7875 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX