diff --git a/sbin/hastd/subr.c b/sbin/hastd/subr.c index 738e5f20947e..62818b21b984 100644 --- a/sbin/hastd/subr.c +++ b/sbin/hastd/subr.c @@ -247,7 +247,7 @@ drop_privs(const struct hast_resource *res) "Unable to limit capability rights on local descriptor"); } if (cap_ioctls_limit(res->hr_localfd, geomcmds, - sizeof(geomcmds) / sizeof(geomcmds[0])) == -1) { + nitems(geomcmds)) == -1) { pjdlog_errno(LOG_ERR, "Unable to limit allowed GEOM ioctls"); } @@ -266,7 +266,7 @@ drop_privs(const struct hast_resource *res) "Unable to limit capability rights to CAP_IOCTL on ggate descriptor"); } if (cap_ioctls_limit(res->hr_ggatefd, ggatecmds, - sizeof(ggatecmds) / sizeof(ggatecmds[0])) == -1) { + nitems(ggatecmds)) == -1) { pjdlog_errno(LOG_ERR, "Unable to limit allowed ggate ioctls"); }