Use sysctl -n rather than parse the output.

From Ngie Cooper in PR bin/51870
This commit is contained in:
maya 2018-01-17 00:23:17 +00:00
parent 687000d215
commit b42dccbff0
3 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: t_sizes.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_sizes.sh,v 1.6 2018/01/17 00:23:17 maya Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -54,7 +54,7 @@ big_head() {
big_body() {
test_mount -o -s10M
pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
pagesize=$(sysctl -n hw.pagesize)
eval $($(atf_get_srcdir)/h_tools statvfs . | sed -e 's|^f_|cf_|')
cf_bused=$((${cf_blocks} - ${cf_bfree}))

View File

@ -1,4 +1,4 @@
# $NetBSD: t_statvfs.sh,v 1.4 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_statvfs.sh,v 1.5 2018/01/17 00:23:17 maya Exp $
#
# Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,7 +38,7 @@ values_head() {
values_body() {
test_mount -o -s10M
pagesize=$(sysctl hw.pagesize | cut -d ' ' -f 3)
pagesize=$(sysctl -n hw.pagesize)
eval $($(atf_get_srcdir)/h_tools statvfs .)
[ ${pagesize} -eq ${f_bsize} ] || \
atf_fail "Invalid bsize"

View File

@ -1,4 +1,4 @@
# $NetBSD: t_vnode_leak.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_vnode_leak.sh,v 1.7 2018/01/17 00:23:17 maya Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -36,7 +36,7 @@ main_head() {
}
main_body() {
echo "Lowering kern.maxvnodes to 2000"
sysctl kern.maxvnodes | awk '{ print $3; }' >oldvnodes
sysctl -n kern.maxvnodes >oldvnodes
atf_check -s eq:0 -o ignore -e empty sysctl -w kern.maxvnodes=2000
test_mount -o -s$(((4000 + 2) * 4096))