Print this page
10105 libproject needs smatch fixes

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libproject/common/setproject.c
          +++ new/usr/src/lib/libproject/common/setproject.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   * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright (c) 2012, Joyent, Inc. All rights reserved.
       23 + * Copyright (c) 2018, Joyent, Inc.
  24   24   */
  25   25  
  26   26  
  27   27  #include <sys/task.h>
  28   28  #include <sys/types.h>
  29   29  #include <unistd.h>
  30   30  
  31   31  #include <ctype.h>
  32   32  #include <project.h>
  33   33  #include <rctl.h>
↓ open down ↓ 460 lines elided ↑ open up ↑
 494  494                          return (-1);
 495  495                  }
 496  496                  return (0);
 497  497          }
 498  498  
 499  499          /*
 500  500           * Bind to the pool with 'pool.default' = 'true' if
 501  501           * 'system.bind-default' = 'true'.
 502  502           */
 503  503          if ((pvals[0] = pool_value_alloc()) == NULL) {
 504      -                pool_conf_close(conf);
      504 +                (void) pool_conf_close(conf);
 505  505                  pool_conf_free(conf);
 506  506                  return (-1);
 507  507          }
 508  508          if (!force && pool_get_property(conf, pool_conf_to_elem(conf),
 509  509              "system.bind-default", pvals[0]) != POC_BOOL ||
 510  510              pool_value_get_bool(pvals[0], &bval) != PO_SUCCESS ||
 511  511              bval == PO_FALSE) {
 512  512                  pool_value_free(pvals[0]);
 513      -                pool_conf_close(conf);
      513 +                (void) pool_conf_close(conf);
 514  514                  pool_conf_free(conf);
 515  515                  errno = pool_name == NULL ? EACCES : ESRCH;
 516  516                  return (-1);
 517  517          }
 518  518          (void) pool_value_set_name(pvals[0], "pool.default");
 519  519          pool_value_set_bool(pvals[0], PO_TRUE);
 520  520          if ((pools = pool_query_pools(conf, &nelem, pvals)) == NULL) {
 521  521                  /*
 522  522                   * No default pools exist.
 523  523                   */
 524  524                  pool_value_free(pvals[0]);
 525      -                pool_conf_close(conf);
      525 +                (void) pool_conf_close(conf);
 526  526                  pool_conf_free(conf);
 527  527                  errno = pool_name == NULL ? EACCES : ESRCH;
 528  528                  return (-1);
 529  529          }
 530  530          if (nelem != 1 ||
 531  531              pool_get_property(conf, pool_to_elem(conf, pools[0]), "pool.name",
 532  532              pvals[0]) != POC_STRING) {
 533  533                  /*
 534  534                   * Configuration is invalid.
 535  535                   */
↓ open down ↓ 263 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX