summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-01-17 14:42:56 -0800
committerGitHub <[email protected]>2017-01-17 14:42:56 -0800
commit8e896579562385b76fd44b7c86084f452043e7fd (patch)
tree236ed6070a3c034775c7d3586b878f4643db90ba /cmd
parent2dbf1bf8296f66f24d5e404505c991bfbeec7808 (diff)
OpenZFS 6551 - cmd/zpool: cleanup gcc warnings
Porting Notes: - Many of the fixes proposed by this patch were already applied. In the cases where a different but equivalent fix was made the code was updated with the OpenZFS version to minimize differences. - The zpool_get_vdev_by_name() function was previously removed by commit 235db0a. Authored by: Igor Kozhukhov <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Andy Stormont <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Haakan T Johansson <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/6551 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/b327cd3 Closes #5590
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zpool/zpool_iter.c7
-rw-r--r--cmd/zpool/zpool_main.c3
-rw-r--r--cmd/zpool/zpool_vdev.c5
3 files changed, 11 insertions, 4 deletions
diff --git a/cmd/zpool/zpool_iter.c b/cmd/zpool/zpool_iter.c
index 309247b6b..e93dc0f89 100644
--- a/cmd/zpool/zpool_iter.c
+++ b/cmd/zpool/zpool_iter.c
@@ -23,7 +23,9 @@
* Use is subject to license terms.
*/
-
+/*
+ * Copyright 2016 Igor Kozhukhov <[email protected]>.
+ */
#include <libintl.h>
#include <libuutil.h>
@@ -132,7 +134,8 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, int *err)
for (i = 0; i < argc; i++) {
zpool_handle_t *zhp;
- if ((zhp = zpool_open_canfail(g_zfs, argv[i]))) {
+ if ((zhp = zpool_open_canfail(g_zfs, argv[i])) !=
+ NULL) {
if (add_pool(zhp, zlp) != 0)
*err = B_TRUE;
} else {
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index a96c3c6e2..c0500ec00 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -26,6 +26,7 @@
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
* Copyright (c) 2012 by Cyril Plisko. All rights reserved.
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
+ * Copyright 2016 Igor Kozhukhov <[email protected]>.
*/
#include <assert.h>
@@ -7464,7 +7465,7 @@ find_command_idx(char *command, int *idx)
int
main(int argc, char **argv)
{
- int ret;
+ int ret = 0;
int i = 0;
char *cmdname;
diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c
index 91fe01300..c4ce0aaa6 100644
--- a/cmd/zpool/zpool_vdev.c
+++ b/cmd/zpool/zpool_vdev.c
@@ -23,6 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2016 Intel Corporation.
+ * Copyright 2016 Igor Kozhukhov <[email protected]>.
*/
/*
@@ -776,7 +777,9 @@ get_replication(nvlist_t *nvroot, boolean_t fatal)
uint_t c, children;
nvlist_t *nv;
char *type;
- replication_level_t lastrep = { 0 }, rep, *ret;
+ replication_level_t lastrep = {0};
+ replication_level_t rep;
+ replication_level_t *ret;
boolean_t dontreport;
ret = safe_malloc(sizeof (replication_level_t));