diff options
author | Tomohiro Kusumi <kusumi.tomohiro@gmail.com> | 2019-04-08 02:18:01 +0900 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2019-04-14 11:13:34 -0700 |
commit | 703f791d3538472600571ecde01627df6b47e6d6 (patch) | |
tree | 7e5510dd0e1e6244ea243945e9d65a44a68be54d /tests | |
parent | 96e51d2773cb0f82595f7d29caed0ca4ac653681 (diff) |
Don't hard-code number of ioctls for portability
Use (ZFS_IOC_LAST - ZFS_IOC_FIRST) instead of 256.
It seems 256 is just a number large enough to hold ioctls
at the moment.
Using 256 also causes compile-time warning or error
on platfoms whose enum zfs_ioc definition differs.
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8598
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c index 8855a5358..977b9e2f3 100644 --- a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c +++ b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c @@ -37,7 +37,7 @@ const char *active_test; /* * Tracks which zfs_ioc_t commands were tested */ -boolean_t ioc_tested[256]; +boolean_t ioc_tested[ZFS_IOC_LAST - ZFS_IOC_FIRST]; /* * Legacy ioctls that are skipped (for now) |