Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Feb 2017 07:35:27 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r313632 - in stable/10/contrib/netbsd-tests/lib/libc/gen: . posix_spawn
Message-ID:  <201702110735.v1B7ZROH028648@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Feb 11 07:35:27 2017
New Revision: 313632
URL: https://svnweb.freebsd.org/changeset/base/313632

Log:
  MFC r312102,r312108:
  
  r312102:
  
  Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
  
  r312108:
  
  Delete trailing whitespace and use __arraycount instead of nitems in contrib code

Modified:
  stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
==============================================================================
--- stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c	Sat Feb 11 07:14:45 2017	(r313631)
+++ stable/10/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c	Sat Feb 11 07:35:27 2017	(r313632)
@@ -60,16 +60,16 @@ get_different_scheduler(void)
 
 	/* get current schedule policy */
 	scheduler = sched_getscheduler(0);
-	for (i = 0; i < nitems(schedulers); i++) {
+	for (i = 0; i < __arraycount(schedulers); i++) {
 		if (schedulers[i] == scheduler)
 			break;
 	}
-	ATF_REQUIRE_MSG(i < nitems(schedulers),
+	ATF_REQUIRE_MSG(i < __arraycount(schedulers),
 	    "Unknown current scheduler %d", scheduler);
-					
+
 	/* new scheduler */
 	i++;
-	if (i >= nitems(schedulers))
+	if (i >= __arraycount(schedulers))
 		i = 0;
 	return schedulers[i];
 }
@@ -85,7 +85,7 @@ get_different_priority(int scheduler)
 
 	sched_getparam(0, &param);
 	priority = param.sched_priority;
-	
+
 	/*
 	 * Change numerical value of the priority, to ensure that it
 	 * was set for the spawned child.
@@ -127,7 +127,7 @@ ATF_TC_BODY(t_spawnattr, tc)
 	scheduler = get_different_scheduler();
 	priority = get_different_priority(scheduler);
 	sp.sched_priority = priority;
-	
+
 	sigemptyset(&sig);
 	sigaddset(&sig, SIGUSR1);
 

Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
==============================================================================
--- stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c	Sat Feb 11 07:14:45 2017	(r313631)
+++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_sleep.c	Sat Feb 11 07:35:27 2017	(r313632)
@@ -27,6 +27,7 @@
  */
 
 #ifdef __FreeBSD__
+/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */
 #include <sys/types.h>
 #endif
 #include <sys/cdefs.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702110735.v1B7ZROH028648>