Use nitems() from sys/param.h.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-04-20 00:55:35 +00:00
parent 3ae587fde4
commit 46df5db84e

View File

@ -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");
}