svn commit: r273397 - head/contrib/netbsd-tests/lib/libc/sys

Garrett Cooper ngie at FreeBSD.org
Tue Oct 21 18:10:05 UTC 2014


Author: ngie
Date: Tue Oct 21 18:10:05 2014
New Revision: 273397
URL: https://svnweb.freebsd.org/changeset/base/273397

Log:
  Port t_chroot to FreeBSD
  
  - Add missing #include sys/stat.h for mkdir(2)
  - Omit the fchroot(2) tests because the support is not present on FreeBSD
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c	Tue Oct 21 18:06:04 2014	(r273396)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_chroot.c	Tue Oct 21 18:10:05 2014	(r273397)
@@ -42,6 +42,10 @@ __RCSID("$NetBSD: t_chroot.c,v 1.1 2011/
 #include <string.h>
 #include <unistd.h>
 
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
+
 ATF_TC(chroot_basic);
 ATF_TC_HEAD(chroot_basic, tc)
 {
@@ -167,6 +171,7 @@ ATF_TC_BODY(chroot_perm, tc)
 		atf_tc_fail("chroot(2) succeeded as unprivileged user");
 }
 
+#ifdef __NetBSD__
 ATF_TC(fchroot_basic);
 ATF_TC_HEAD(fchroot_basic, tc)
 {
@@ -298,6 +303,7 @@ ATF_TC_BODY(fchroot_perm, tc)
 	if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
 		atf_tc_fail("fchroot(2) succeeded as unprivileged user");
 }
+#endif
 
 ATF_TP_ADD_TCS(tp)
 {
@@ -305,9 +311,11 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, chroot_basic);
 	ATF_TP_ADD_TC(tp, chroot_err);
 	ATF_TP_ADD_TC(tp, chroot_perm);
+#ifdef __NetBSD__
 	ATF_TP_ADD_TC(tp, fchroot_basic);
 	ATF_TP_ADD_TC(tp, fchroot_err);
 	ATF_TP_ADD_TC(tp, fchroot_perm);
+#endif
 
 	return atf_no_error();
 }


More information about the svn-src-head mailing list