summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 09:58:04 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 08:38:43 -0700
commitd4ed667343c3dac114642b9f6cb4f7baa3ff7334 (patch)
tree16b3f627625f83d0214446fb6f867e100f1a34c5 /lib
parent1fde1e37208c2f56c72c70a06676676f04b65998 (diff)
Fix gcc uninitialized variable warnings
Gcc -Wall warn: 'uninitialized variable' Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_dataset.c9
-rw-r--r--lib/libzfs/libzfs_import.c2
-rw-r--r--lib/libzfs/libzfs_util.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 32cdd636a..a0146b4e4 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -1362,7 +1362,7 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
zfs_prop_t prop;
boolean_t do_prefix;
uint64_t idx;
- int added_resv;
+ int added_resv = 0;
(void) snprintf(errbuf, sizeof (errbuf),
dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
@@ -2791,7 +2791,7 @@ zfs_create_ancestors(libzfs_handle_t *hdl, const char *path)
{
int prefix;
char *path_copy;
- int rc;
+ int rc = 0;
if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0)
return (-1);
@@ -3348,8 +3348,8 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
int err;
zfs_cmd_t zc = { "\0", "\0", "\0", "\0", 0 };
boolean_t restore_resv = 0;
- uint64_t old_volsize, new_volsize;
- zfs_prop_t resv_prop;
+ uint64_t old_volsize = 0, new_volsize;
+ zfs_prop_t resv_prop = { 0 };
assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM ||
zhp->zfs_type == ZFS_TYPE_VOLUME);
@@ -3579,6 +3579,7 @@ zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive)
"child dataset with inherited mountpoint is used "
"in a non-global zone"));
(void) zfs_error(hdl, EZFS_ZONED, errbuf);
+ ret = -1;
goto error;
}
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
index 9629ab083..386ab002f 100644
--- a/lib/libzfs/libzfs_import.c
+++ b/lib/libzfs/libzfs_import.c
@@ -434,7 +434,7 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
pool_entry_t *pe;
vdev_entry_t *ve;
config_entry_t *ce;
- nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot;
+ nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot;
nvlist_t **spares, **l2cache;
uint_t i, nspares, nl2cache;
boolean_t config_seen;
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index fbed42f06..8277bdb02 100644
--- a/lib/libzfs/libzfs_util.c
+++ b/lib/libzfs/libzfs_util.c
@@ -956,7 +956,7 @@ zprop_print_one_property(const char *name, zprop_get_cbdata_t *cbp,
const char *source, const char *recvd_value)
{
int i;
- const char *str;
+ const char *str = NULL;
char buf[128];
/*