aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_dataset.c
diff options
context:
space:
mode:
authorTomohiro Kusumi <[email protected]>2018-04-13 02:50:39 +0900
committerBrian Behlendorf <[email protected]>2018-04-12 10:50:39 -0700
commit8111eb4abc96a173845a553dc7d65382398f0683 (patch)
treeeca13f7bad728d865cffe4131dac3962f52b29ef /lib/libzfs/libzfs_dataset.c
parent7403d0743e2b75b7f5412a14007ba159efb67a7d (diff)
Fix calloc(3) arguments order
calloc(3) takes `nelem` (or `nmemb` in glibc) first, and then size of elements. No difference expected for having these in reverse order, however should follow the standard. http://pubs.opengroup.org/onlinepubs/009695399/functions/calloc.html Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tomohiro Kusumi <[email protected]> Closes #7405
Diffstat (limited to 'lib/libzfs/libzfs_dataset.c')
-rw-r--r--lib/libzfs/libzfs_dataset.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index acfcb7491..65834b6d1 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -466,7 +466,7 @@ make_dataset_handle(libzfs_handle_t *hdl, const char *path)
{
zfs_cmd_t zc = {"\0"};
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
+ zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
if (zhp == NULL)
return (NULL);
@@ -493,7 +493,7 @@ make_dataset_handle(libzfs_handle_t *hdl, const char *path)
zfs_handle_t *
make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
{
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
+ zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
if (zhp == NULL)
return (NULL);
@@ -510,7 +510,7 @@ make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
zfs_handle_t *
make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc)
{
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
+ zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
if (zhp == NULL)
return (NULL);
@@ -527,7 +527,7 @@ make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc)
zfs_handle_t *
zfs_handle_dup(zfs_handle_t *zhp_orig)
{
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
+ zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
if (zhp == NULL)
return (NULL);
@@ -607,7 +607,7 @@ zfs_handle_t *
make_bookmark_handle(zfs_handle_t *parent, const char *path,
nvlist_t *bmark_props)
{
- zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
+ zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
if (zhp == NULL)
return (NULL);