Print this page
5526 One more gcc warning for cmd/power

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/power/handlers.c
          +++ new/usr/src/cmd/power/handlers.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  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 + * Copyright 2015 Gary Mills
  22   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  #include "pmconfig.h"
  27   28  #include <sys/mkdev.h>
  28   29  #include <sys/syslog.h>
  29   30  #include <sys/openpromio.h>
  30   31  #include <sys/mnttab.h>
  31   32  #include <sys/vtoc.h>
↓ open down ↓ 976 lines elided ↑ open up ↑
1008 1009          libzfs_handle_t *lzfs;
1009 1010          char *vname;
1010 1011          char *p;
1011 1012          char pool_name[MAXPATHLEN];
1012 1013  
1013 1014          if (strncmp(arg, "/dev/zvol/dsk/", 14)) {
1014 1015                  return (0);
1015 1016          }
1016 1017          arg += 14;
1017 1018          (void) strncpy(pool_name, arg, MAXPATHLEN);
1018      -        if (p = strchr(pool_name, '/'))
     1019 +        if ((p = strchr(pool_name, '/')) != NULL)
1019 1020                  *p = '\0';
1020 1021          STRCPYLIM(new_cc.cf_fs, p + 1, "statefile path");
1021 1022  
1022 1023          if ((lzfs = libzfs_init()) == NULL) {
1023 1024                  mesg(MERR, "failed to initialize ZFS library\n");
1024 1025                  return (-1);
1025 1026          }
1026 1027          if ((zpool_handle = zpool_open(lzfs, pool_name)) == NULL) {
1027 1028                  mesg(MERR, "couldn't open pool '%s'\n", pool_name);
1028 1029                  libzfs_fini(lzfs);
↓ open down ↓ 222 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX