From d4dbc7dca843c140a058ec8e873d6c43f5d0d12a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 20:52:21 -0700 Subject: [PATCH 1/2] Resolve all instances of missing braces. --- .topdeps | 1 + .topmsg | 6 +++++ cmd/zdb/zdb.c | 7 ++++-- cmd/ztest/ztest.c | 3 ++- lib/libzfs/libzfs_config.c | 4 ++-- lib/libzfs/libzfs_dataset.c | 42 +++++++++++++++++----------------- lib/libzfs/libzfs_graph.c | 4 ++-- lib/libzfs/libzfs_import.c | 2 +- lib/libzfs/libzfs_pool.c | 44 ++++++++++++++++++------------------ lib/libzfs/libzfs_sendrecv.c | 20 ++++++++-------- module/zfs/dsl_dataset.c | 3 ++- 11 files changed, 74 insertions(+), 62 deletions(-) create mode 100644 .topdeps create mode 100644 .topmsg diff --git a/.topdeps b/.topdeps new file mode 100644 index 0000000000..1f7391f92b --- /dev/null +++ b/.topdeps @@ -0,0 +1 @@ +master diff --git a/.topmsg b/.topmsg new file mode 100644 index 0000000000..16b57e4eab --- /dev/null +++ b/.topmsg @@ -0,0 +1,6 @@ +From: Brian Behlendorf +Subject: [PATCH] gcc missing braces + +Resolve compiler warnings concerning missing braces. + +Signed-off-by: Brian Behlendorf diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 0ced258656..f75e7a8388 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -817,7 +817,7 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size) static void dump_bplist(objset_t *mos, uint64_t object, char *name) { - bplist_t bpl = { 0 }; + bplist_t bpl; blkptr_t blk, *bp = &blk; uint64_t itor = 0; char bytes[6]; @@ -827,6 +827,7 @@ dump_bplist(objset_t *mos, uint64_t object, char *name) if (dump_opt['d'] < 3) return; + bzero(&bpl, sizeof(bplist_t)); mutex_init(&bpl.bpl_lock, NULL, MUTEX_DEFAULT, NULL); VERIFY(0 == bplist_open(&bpl, mos, object)); if (bplist_empty(&bpl)) { @@ -1563,13 +1564,15 @@ zdb_blkptr_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb, static int dump_block_stats(spa_t *spa) { - zdb_cb_t zcb = { 0 }; + zdb_cb_t zcb; zdb_blkstats_t *zb, *tzb; uint64_t alloc, space, logalloc; vdev_t *rvd = spa->spa_root_vdev; int leaks = 0; int c, e; + bzero(&zcb, sizeof(zdb_cb_t)); + if (!dump_opt['S']) { (void) printf("\nTraversing all blocks %s%s%s%s...\n", (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 4503a3d028..f5cf6311fe 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1931,11 +1931,12 @@ ztest_dmu_write_parallel(ztest_args_t *za) mutex_t *lp; char osname[MAXNAMELEN]; char iobuf[SPA_MAXBLOCKSIZE]; - blkptr_t blk = { 0 }; + blkptr_t blk; uint64_t blkoff; zbookmark_t zb; dmu_tx_t *tx = dmu_tx_create(os); + bzero(&blk, sizeof(blkptr_t)); dmu_objset_name(os, osname); /* diff --git a/lib/libzfs/libzfs_config.c b/lib/libzfs/libzfs_config.c index 94640d1b12..85539c3e36 100644 --- a/lib/libzfs/libzfs_config.c +++ b/lib/libzfs/libzfs_config.c @@ -103,7 +103,7 @@ namespace_reload(libzfs_handle_t *hdl) nvlist_t *config; config_node_t *cn; nvpair_t *elem; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; void *cookie; if (hdl->libzfs_ns_gen == 0) { @@ -228,7 +228,7 @@ zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig) int zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int error; nvlist_t *config; libzfs_handle_t *hdl = zhp->zpool_hdl; diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index a381a0e63a..15e279bb07 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -364,7 +364,7 @@ static int get_stats(zfs_handle_t *zhp) { int rc = 0; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0) return (-1); @@ -411,7 +411,7 @@ top: if (zhp->zfs_dmustats.dds_inconsistent) { - zfs_cmd_t zc2 = { 0 }; + zfs_cmd_t zc2 = { "\0", "\0", "\0", 0 }; /* * If it is dds_inconsistent, then we've caught it in @@ -485,7 +485,7 @@ top: zfs_handle_t * make_dataset_handle(libzfs_handle_t *hdl, const char *path) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); @@ -1380,7 +1380,7 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms, static int zfs_perm_set_common(zfs_handle_t *zhp, nvlist_t *nvp, boolean_t unset) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int error; char errbuf[1024]; @@ -1594,7 +1594,7 @@ zfs_coalesce_perm(zfs_handle_t *zhp, zfs_allow_node_t *allownode, int zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int error; nvlist_t *nvlist; nvlist_t *permnv, *sourcenv; @@ -1928,7 +1928,7 @@ zfs_deleg_permissions(void) int zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret = -1; prop_changelist_t *cl = NULL; char errbuf[1024]; @@ -2088,7 +2088,7 @@ error: int zfs_prop_inherit(zfs_handle_t *zhp, const char *propname) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret; prop_changelist_t *cl; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -2238,7 +2238,7 @@ static int get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, char **source, uint64_t *val) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; nvlist_t *zplprops = NULL; struct mnttab mnt; char *mntopt_on = NULL; @@ -2784,7 +2784,7 @@ top: int zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zfs_handle_t *nzhp; int ret; @@ -2826,7 +2826,7 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) int zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zfs_handle_t *nzhp; int ret; @@ -2896,7 +2896,7 @@ static int check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned, boolean_t accept_ancestor, int *prefixlen) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char parent[ZFS_MAXNAMELEN]; char *slash; zfs_handle_t *zhp; @@ -3101,7 +3101,7 @@ int zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, nvlist_t *props) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret; uint64_t size = 0; uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); @@ -3264,7 +3264,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, int zfs_destroy(zfs_handle_t *zhp) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); @@ -3344,7 +3344,7 @@ zfs_remove_link_cb(zfs_handle_t *zhp, void *arg) int zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret; struct destroydata dd = { 0 }; @@ -3388,7 +3388,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname) int zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char parent[ZFS_MAXNAMELEN]; int ret; char errbuf[1024]; @@ -3537,7 +3537,7 @@ int zfs_promote(zfs_handle_t *zhp) { libzfs_handle_t *hdl = zhp->zfs_hdl; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char parent[MAXPATHLEN]; char *cp; int ret; @@ -3660,7 +3660,7 @@ zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive, const char *delim; char parent[ZFS_MAXNAMELEN]; zfs_handle_t *zhp; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret; char errbuf[1024]; @@ -3812,7 +3812,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force) { rollback_data_t cb = { 0 }; int err; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; boolean_t restore_resv = 0; uint64_t old_volsize, new_volsize; zfs_prop_t resv_prop; @@ -3934,7 +3934,7 @@ int zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive) { int ret; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char *delim; prop_changelist_t *cl = NULL; zfs_handle_t *zhrp = NULL; @@ -4251,7 +4251,7 @@ zvol_create_link_common(libzfs_handle_t *hdl, const char *dataset, int ifexists) int zvol_remove_link(libzfs_handle_t *hdl, const char *dataset) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); @@ -4426,7 +4426,7 @@ int zfs_deleg_share_nfs(libzfs_handle_t *hdl, char *dataset, char *path, void *export, void *sharetab, int sharemax, zfs_share_op_t operation) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int error; (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name)); diff --git a/lib/libzfs/libzfs_graph.c b/lib/libzfs/libzfs_graph.c index e7cbf23860..6fcedfc8d1 100644 --- a/lib/libzfs/libzfs_graph.c +++ b/lib/libzfs/libzfs_graph.c @@ -381,7 +381,7 @@ zfs_graph_add(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *source, static int iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zfs_vertex_t *zvp; /* @@ -482,7 +482,7 @@ iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) static boolean_t external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; /* * Check whether this dataset is a clone or has clones since diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index d67776889d..67036b2949 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -367,7 +367,7 @@ static nvlist_t * refresh_config(libzfs_handle_t *hdl, nvlist_t *config) { nvlist_t *nvl; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int err; if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 75ecc54e27..6de2452b2e 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -64,7 +64,7 @@ static int read_efi_label(nvlist_t *config, diskaddr_t *sb); static int zpool_get_all_props(zpool_handle_t *zhp) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); @@ -548,7 +548,7 @@ error: int zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret = -1; char errbuf[1024]; nvlist_t *nvl = NULL; @@ -853,7 +853,7 @@ int zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot, nvlist_t *props, nvlist_t *fsprops) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; @@ -983,7 +983,7 @@ create_failed: int zpool_destroy(zpool_handle_t *zhp) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zfs_handle_t *zfp = NULL; libzfs_handle_t *hdl = zhp->zpool_hdl; char msg[1024]; @@ -1030,7 +1030,7 @@ zpool_destroy(zpool_handle_t *zhp) int zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int ret; libzfs_handle_t *hdl = zhp->zpool_hdl; char msg[1024]; @@ -1153,7 +1153,7 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot) int zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; if (zpool_remove_zvol_links(zhp) != 0) @@ -1245,7 +1245,7 @@ int zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, nvlist_t *props, boolean_t importfaulted) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char *thename; char *origname; int ret; @@ -1349,7 +1349,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, int zpool_scrub(zpool_handle_t *zhp, pool_scrub_type_t type) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -1614,7 +1614,7 @@ int zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags, vdev_state_t *newstate) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -1650,7 +1650,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags, int zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -1695,7 +1695,7 @@ zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp) int zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -1729,7 +1729,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid) int zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -1782,7 +1782,7 @@ int zpool_vdev_attach(zpool_handle_t *zhp, const char *old_disk, const char *new_disk, nvlist_t *nvroot, int replacing) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; int ret; nvlist_t *tgt; @@ -1965,7 +1965,7 @@ zpool_vdev_attach(zpool_handle_t *zhp, int zpool_vdev_detach(zpool_handle_t *zhp, const char *path) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -2022,7 +2022,7 @@ zpool_vdev_detach(zpool_handle_t *zhp, const char *path) int zpool_vdev_remove(zpool_handle_t *zhp, const char *path) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -2057,7 +2057,7 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path) int zpool_clear(zpool_handle_t *zhp, const char *path) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; nvlist_t *tgt; boolean_t avail_spare, l2cache; @@ -2101,7 +2101,7 @@ zpool_clear(zpool_handle_t *zhp, const char *path) int zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; char msg[1024]; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2351,7 +2351,7 @@ path_to_devid(const char *path) static void set_path(zpool_handle_t *zhp, nvlist_t *nv, const char *path) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value)); @@ -2474,7 +2474,7 @@ zbookmark_compare(const void *a, const void *b) int zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; uint64_t count; zbookmark_t *zb = NULL; int i; @@ -2570,7 +2570,7 @@ nomem: int zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strcpy(zc.zc_name, zhp->zpool_name); @@ -2632,7 +2632,7 @@ zpool_stage_history(libzfs_handle_t *hdl, const char *history_str) static int get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zpool_hdl; (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); @@ -2759,7 +2759,7 @@ void zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj, char *pathname, size_t len) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; boolean_t mounted = B_FALSE; char *mntpnt = NULL; char dsname[MAXNAMELEN]; diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 5a2e2aeb6d..9c395381bc 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -451,7 +451,7 @@ static int dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, boolean_t fromorigin, int outfd) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); @@ -552,7 +552,7 @@ dump_filesystem(zfs_handle_t *zhp, void *arg) int rv = 0; send_dump_data_t *sdd = arg; boolean_t missingfrom = B_FALSE; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; (void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s", zhp->zfs_name, sdd->tosnap); @@ -709,7 +709,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap, dmu_replay_record_t drr = { 0 }; char *packbuf = NULL; size_t buflen = 0; - zio_cksum_t zc = { 0 }; + zio_cksum_t zc = { { 0 } }; assert(fromsnap || doall); @@ -875,7 +875,7 @@ recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname, int baselen, char *newname, recvflags_t flags) { static int seq; - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int err; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -947,7 +947,7 @@ static int recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen, char *newname, recvflags_t flags) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; int err = 0; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -1158,7 +1158,7 @@ again: stream_originguid, originguid)) { case 1: { /* promote it! */ - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; nvlist_t *origin_nvfs; char *origin_fsname; @@ -1230,7 +1230,7 @@ again: if (0 == nvlist_lookup_nvlist(stream_nvfs, "snapprops", &props) && 0 == nvlist_lookup_nvlist(props, stream_snapname, &props)) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; zc.zc_cookie = B_TRUE; /* clear current props */ (void) snprintf(zc.zc_name, sizeof (zc.zc_name), @@ -1556,7 +1556,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, dmu_replay_record_t *drr_noswap, avl_tree_t *stream_avl, char **top_zfs) { - zfs_cmd_t zc = { 0 }; + zfs_cmd_t zc = { "\0", "\0", "\0", 0 }; time_t begin_time; int ioctl_err, ioctl_errno, err, choplen; char *cp; @@ -1835,7 +1835,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, zcmd_free_nvlists(&zc); if (err == 0 && snapprops_nvlist) { - zfs_cmd_t zc2 = { 0 }; + zfs_cmd_t zc2 = { "\0", "\0", "\0", 0 }; (void) strcpy(zc2.zc_name, zc.zc_value); if (zcmd_write_src_nvlist(hdl, &zc2, snapprops_nvlist) == 0) { @@ -1990,7 +1990,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags, dmu_replay_record_t drr, drr_noswap; struct drr_begin *drrb = &drr.drr_u.drr_begin; char errbuf[1024]; - zio_cksum_t zcksum = { 0 }; + zio_cksum_t zcksum = { { 0 } }; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot receive")); diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index a68b12d339..e16154d7fd 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -2613,10 +2613,11 @@ dsl_dataset_promote(const char *name) dsl_dir_t *dd; dsl_pool_t *dp; dmu_object_info_t doi; - struct promotearg pa = { 0 }; + struct promotearg pa; struct promotenode *snap; int err; + bzero(&pa, sizeof(struct promotearg)); err = dsl_dataset_hold(name, FTAG, &ds); if (err) return (err); From 3f6e148695c45af8695e8cc6b8a01f29a059aa84 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 20:53:08 -0700 Subject: [PATCH 2/2] New TopGit dependency: gcc-missing-braces --- .topdeps | 1 + 1 file changed, 1 insertion(+) diff --git a/.topdeps b/.topdeps index 91b8a91351..8b9694c75b 100644 --- a/.topdeps +++ b/.topdeps @@ -10,3 +10,4 @@ gcc-unused gcc-shadow gcc-64bit-constants gcc-ident-pragmas +gcc-missing-braces