From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 07:54:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BD118D9; Thu, 23 Oct 2014 07:54:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6803BAC2; Thu, 23 Oct 2014 07:54:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9N7slQd082118; Thu, 23 Oct 2014 07:54:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9N7slW1082117; Thu, 23 Oct 2014 07:54:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410230754.s9N7slW1082117@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 23 Oct 2014 07:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273533 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2014 07:54:47 -0000 Author: ngie Date: Thu Oct 23 07:54:46 2014 New Revision: 273533 URL: https://svnweb.freebsd.org/changeset/base/273533 Log: Use /truncate_test.root_owned instead of /usr/bin/fpr as fpr does not exist on FreeBSD truncate_test.root_owned will be generated at build time and owned by root In collaboration with: pho Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/sys/t_truncate.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_truncate.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_truncate.c Thu Oct 23 07:37:48 2014 (r273532) +++ head/contrib/netbsd-tests/lib/libc/sys/t_truncate.c Thu Oct 23 07:54:46 2014 (r273533) @@ -40,6 +40,10 @@ __RCSID("$NetBSD: t_truncate.c,v 1.2 201 #include #include +#ifdef __FreeBSD__ +#include +#endif + static const char path[] = "truncate"; static const size_t sizes[] = { 8, 16, 512, 1024, 2048, 4094, 3000, 30 }; @@ -149,6 +153,9 @@ ATF_TC_HEAD(truncate_err, tc) ATF_TC_BODY(truncate_err, tc) { +#ifndef __NetBSD__ + char buf[PATH_MAX]; +#endif errno = 0; ATF_REQUIRE_ERRNO(EFAULT, truncate((void *)-1, 999) == -1); @@ -160,7 +167,13 @@ ATF_TC_BODY(truncate_err, tc) ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1); errno = 0; +#ifdef __NetBSD__ ATF_REQUIRE_ERRNO(EACCES, truncate("/usr/bin/fpr", 999) == -1); +#else + snprintf(buf, sizeof(buf), "%s/truncate_test.root_owned", + atf_tc_get_config_var(tc, "srcdir")); + ATF_REQUIRE_ERRNO(EACCES, truncate(buf, 999) == -1); +#endif } ATF_TP_ADD_TCS(tp)