Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/restarter.c
          +++ new/usr/src/cmd/svc/startd/restarter.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 2018 Joyent, Inc.
       24 + * Copyright 2019 Joyent, Inc.
  25   25   */
  26   26  
  27   27  /*
  28   28   * restarter.c - service manipulation
  29   29   *
  30   30   * This component manages services whose restarter is svc.startd, the standard
  31   31   * restarter.  It translates restarter protocol events from the graph engine
  32   32   * into actions on processes, as a delegated restarter would do.
  33   33   *
  34   34   * The master restarter manages a number of always-running threads:
↓ open down ↓ 2048 lines elided ↑ open up ↑
2083 2083                                      &rip->ri_queue_cv);
2084 2084                          }
2085 2085  
2086 2086                          MUTEX_UNLOCK(&rip->ri_queue_lock);
2087 2087  nolookup:
2088 2088                          restarter_event_release(e);
2089 2089  
2090 2090                          MUTEX_LOCK(&ru->restarter_update_lock);
2091 2091                  }
2092 2092          }
2093      -
2094      -        /*
2095      -         * Unreachable for now -- there's currently no graceful cleanup
2096      -         * called on exit().
2097      -         */
2098      -        (void) scf_handle_unbind(h);
2099      -        scf_handle_destroy(h);
2100      -        return (NULL);
2101 2093  }
2102 2094  
2103 2095  static restarter_inst_t *
2104 2096  contract_to_inst(ctid_t ctid)
2105 2097  {
2106 2098          restarter_inst_t *inst;
2107 2099          int id;
2108 2100  
2109 2101          id = lookup_inst_by_contract(ctid);
2110 2102          if (id == -1)
↓ open down ↓ 506 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX