From 46df5db84e3ba506dc95c936be740db6a18e8581 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Wed, 20 Apr 2016 00:55:35 +0000 Subject: [PATCH] Use nitems() from sys/param.h. MFC after: 2 weeks. --- sbin/hastd/subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); }