diff options
author | Ryan Moeller <[email protected]> | 2022-06-08 13:08:10 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-06-09 15:24:24 -0700 |
commit | d68a2bfa994d3d064924e8c303a9a7e8e6e02682 (patch) | |
tree | f2ee2fbc4b3d181f1f4e3e8e1f17bae7b0857ebb /lib/libzfs/libzfs_pool.c | |
parent | 6f73d02168ea4d4c27e95d3f23df7221c7321e07 (diff) |
libzfs: Define the defecto standard errbuf size
Every errbuf array in libzfs is 1024 chars.
Define ERRBUFLEN in a shared header, and use it.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #13539
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 730e6db53..98cae5a04 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -776,7 +776,7 @@ zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval) { zfs_cmd_t zc = {"\0"}; int ret = -1; - char errbuf[1024]; + char errbuf[ERRBUFLEN]; nvlist_t *nvl = NULL; nvlist_t *realprops; uint64_t version; @@ -2009,7 +2009,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname, char *origname; int ret; int error = 0; - char errbuf[1024]; + char errbuf[ERRBUFLEN]; origname = fnvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME); @@ -4998,7 +4998,7 @@ zpool_vdev_guid(zpool_handle_t *zhp, const char *vdevname, uint64_t *vdev_guid) verify(zhp != NULL); if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) { - char errbuf[1024]; + char errbuf[ERRBUFLEN]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "pool is in an unavailable state")); return (zfs_error(zhp->zpool_hdl, EZFS_POOLUNAVAIL, errbuf)); @@ -5006,7 +5006,7 @@ zpool_vdev_guid(zpool_handle_t *zhp, const char *vdevname, uint64_t *vdev_guid) if ((tgt = zpool_find_vdev(zhp, vdevname, &avail_spare, &l2cache, NULL)) == NULL) { - char errbuf[1024]; + char errbuf[ERRBUFLEN]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "can not find %s in %s"), vdevname, zhp->zpool_name); @@ -5216,7 +5216,7 @@ zpool_get_vdev_prop(zpool_handle_t *zhp, const char *vdevname, vdev_prop_t prop, ret = zpool_get_vdev_prop_value(retprops, prop, prop_name, buf, len, srctype, literal); } else { - char errbuf[1024]; + char errbuf[ERRBUFLEN]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get vdev property %s from" " %s in %s"), prop_name, vdevname, zhp->zpool_name); @@ -5254,7 +5254,7 @@ zpool_get_all_vdev_props(zpool_handle_t *zhp, const char *vdevname, nvlist_free(nvl); if (ret) { - char errbuf[1024]; + char errbuf[ERRBUFLEN]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get vdev properties for" " %s in %s"), vdevname, zhp->zpool_name); @@ -5295,7 +5295,7 @@ zpool_set_vdev_prop(zpool_handle_t *zhp, const char *vdevname, return (no_memory(zhp->zpool_hdl)); } - char errbuf[1024]; + char errbuf[ERRBUFLEN]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot set property %s for %s on %s"), propname, vdevname, zhp->zpool_name); |