diff options
author | Brian Behlendorf <[email protected]> | 2010-08-26 09:58:04 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-08-31 08:38:43 -0700 |
commit | d4ed667343c3dac114642b9f6cb4f7baa3ff7334 (patch) | |
tree | 16b3f627625f83d0214446fb6f867e100f1a34c5 /cmd | |
parent | 1fde1e37208c2f56c72c70a06676676f04b65998 (diff) |
Fix gcc uninitialized variable warnings
Gcc -Wall warn: 'uninitialized variable'
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zdb/zdb.c | 2 | ||||
-rw-r--r-- | cmd/zfs/zfs_main.c | 5 | ||||
-rw-r--r-- | cmd/zpool/zpool_main.c | 5 | ||||
-rw-r--r-- | cmd/zpool/zpool_vdev.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 1a458f604..459445bb7 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -2888,7 +2888,7 @@ find_zpool(char **target, nvlist_t **configp, int dirc, char **dirv) nvlist_t *match = NULL; char *name = NULL; char *sepp = NULL; - char sep; + char sep = 0; int count = 0; importargs_t args = { 0 }; diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 22426ebfd..9cb69c1bf 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -671,7 +671,7 @@ zfs_do_create(int argc, char **argv) { zfs_type_t type = ZFS_TYPE_FILESYSTEM; zfs_handle_t *zhp = NULL; - uint64_t volsize; + uint64_t volsize = 0; int c; boolean_t noreserve = B_FALSE; boolean_t bflag = B_FALSE; @@ -4060,7 +4060,7 @@ int main(int argc, char **argv) { int ret; - int i; + int i = 0; char *progname; char *cmdname; @@ -4139,6 +4139,7 @@ main(int argc, char **argv) (void) fprintf(stderr, gettext("unrecognized " "command '%s'\n"), cmdname); usage(B_FALSE); + ret = 1; } libzfs_mnttab_cache(g_zfs, B_FALSE); } diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 85a51de40..fa16836fe 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -3269,7 +3269,7 @@ print_scan_status(pool_scan_stat_t *ps) */ if (ps->pss_state == DSS_FINISHED) { uint64_t minutes_taken = (end - start) / 60; - char *fmt; + char *fmt = NULL; if (ps->pss_func == POOL_SCAN_SCRUB) { fmt = gettext("scrub repaired %s in %lluh%um with " @@ -4392,7 +4392,7 @@ int main(int argc, char **argv) { int ret; - int i; + int i = 0; char *cmdname; (void) setlocale(LC_ALL, ""); @@ -4450,6 +4450,7 @@ main(int argc, char **argv) (void) fprintf(stderr, gettext("unrecognized " "command '%s'\n"), cmdname); usage(B_FALSE); + ret = 1; } libzfs_fini(g_zfs); diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 53c2e60b7..0c224903d 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -548,7 +548,7 @@ get_replication(nvlist_t *nvroot, boolean_t fatal) uint_t c, children; nvlist_t *nv; char *type; - replication_level_t lastrep, rep, *ret; + replication_level_t lastrep = { 0 }, rep, *ret; boolean_t dontreport; ret = safe_malloc(sizeof (replication_level_t)); |