Author: araujo
Date: Wed Apr 20 00:55:35 2016
New Revision: 298317
URL: https://svnweb.freebsd.org/changeset/base/298317

Log:
  Use nitems() from sys/param.h.
  
  MFC after:    2 weeks.

Modified:
  head/sbin/hastd/subr.c

Modified: head/sbin/hastd/subr.c
==============================================================================
--- head/sbin/hastd/subr.c      Wed Apr 20 00:50:17 2016        (r298316)
+++ head/sbin/hastd/subr.c      Wed Apr 20 00:55:35 2016        (r298317)
@@ -247,7 +247,7 @@ drop_privs(const struct hast_resource *r
                            "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 *r
                                    "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");
                        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to