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/graph.c
          +++ new/usr/src/cmd/svc/startd/graph.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   * Copyright (c) 2015, Syneto S.R.L. All rights reserved.
  26   26   * Copyright 2016 Toomas Soome <tsoome@me.com>
  27   27   * Copyright 2016 RackTop Systems.
  28   28   */
  29   29  
  30   30  /*
  31   31   * graph.c - master restarter graph engine
  32   32   *
  33   33   *   The graph engine keeps a dependency graph of all service instances on the
  34   34   *   system, as recorded in the repository.  It decides when services should
↓ open down ↓ 5775 lines elided ↑ open up ↑
5810 5810                          if (err == 0)
5811 5811                                  graph_event_release(e);
5812 5812                          else
5813 5813                                  graph_event_requeue(e);
5814 5814  
5815 5815                          MUTEX_LOCK(&gu->gu_lock);
5816 5816                  }
5817 5817  
5818 5818                  MUTEX_UNLOCK(&gu->gu_lock);
5819 5819          }
5820      -
5821      -        /*
5822      -         * Unreachable for now -- there's currently no graceful cleanup
5823      -         * called on exit().
5824      -         */
5825      -        MUTEX_UNLOCK(&gu->gu_lock);
5826      -        scf_handle_destroy(h);
5827      -        return (NULL);
5828 5820  }
5829 5821  
5830 5822  static void
5831 5823  set_initial_milestone(scf_handle_t *h)
5832 5824  {
5833 5825          scf_instance_t *inst;
5834 5826          char *fmri, *cfmri;
5835 5827          size_t sz;
5836 5828          int r;
5837 5829  
↓ open down ↓ 345 lines elided ↑ open up ↑
6183 6175          }
6184 6176          MUTEX_UNLOCK(&dgraph_lock);
6185 6177  
6186 6178          (void) pthread_mutex_lock(&gu->gu_freeze_lock);
6187 6179  
6188 6180          /*CONSTCOND*/
6189 6181          while (1) {
6190 6182                  (void) pthread_cond_wait(&gu->gu_freeze_cv,
6191 6183                      &gu->gu_freeze_lock);
6192 6184          }
6193      -
6194      -        /*
6195      -         * Unreachable for now -- there's currently no graceful cleanup
6196      -         * called on exit().
6197      -         */
6198      -        (void) pthread_mutex_unlock(&gu->gu_freeze_lock);
6199      -        scf_handle_destroy(h);
6200      -
6201      -        return (NULL);
6202 6185  }
6203 6186  
6204 6187  
6205 6188  /*
6206 6189   * int next_action()
6207 6190   *   Given an array of timestamps 'a' with 'num' elements, find the
6208 6191   *   lowest non-zero timestamp and return its index. If there are no
6209 6192   *   non-zero elements, return -1.
6210 6193   */
6211 6194  static int
↓ open down ↓ 697 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX