NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/51870: [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
The following reply was made to PR bin/51870; it has been noted by GNATS.
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/51870: [PATCH] tests/fs/tmpfs: various fixes from FreeBSD
Date: Fri, 13 Jan 2017 20:37:41 -0800
--Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Patch attached.
-Ngie
--Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD
Content-Disposition: attachment;
filename=tests-fs-tmpfs-various-fixes.patch
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="tests-fs-tmpfs-various-fixes.patch"
Content-Transfer-Encoding: 7bit
? fs/tmpfs/obj
Index: fs/tmpfs/h_tools.c
===================================================================
RCS file: /cvsroot/src/tests/fs/tmpfs/h_tools.c,v
retrieving revision 1.4
diff -u -r1.4 h_tools.c
--- fs/tmpfs/h_tools.c 11 Jun 2011 18:03:17 -0000 1.4
+++ fs/tmpfs/h_tools.c 14 Jan 2017 04:32:12 -0000
@@ -45,6 +45,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -230,12 +231,13 @@
return EXIT_FAILURE;
}
+ memset(&addr, 0, sizeof(addr));
(void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path));
addr.sun_family = PF_UNIX;
-
- error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
+ error = bind(fd, (struct sockaddr *)&addr, SUN_LEN(&addr));
if (error == -1) {
warn("connect");
+ (void)close(fd);
return EXIT_FAILURE;
}
Index: fs/tmpfs/t_sizes.sh
===================================================================
RCS file: /cvsroot/src/tests/fs/tmpfs/t_sizes.sh,v
retrieving revision 1.5
diff -u -r1.5 t_sizes.sh
--- fs/tmpfs/t_sizes.sh 7 Nov 2010 17:51:18 -0000 1.5
+++ fs/tmpfs/t_sizes.sh 14 Jan 2017 04:32:12 -0000
@@ -54,7 +54,7 @@
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}))
Index: fs/tmpfs/t_statvfs.sh
===================================================================
RCS file: /cvsroot/src/tests/fs/tmpfs/t_statvfs.sh,v
retrieving revision 1.4
diff -u -r1.4 t_statvfs.sh
--- fs/tmpfs/t_statvfs.sh 7 Nov 2010 17:51:18 -0000 1.4
+++ fs/tmpfs/t_statvfs.sh 14 Jan 2017 04:32:12 -0000
@@ -38,7 +38,7 @@
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"
Index: fs/tmpfs/t_vnode_leak.sh
===================================================================
RCS file: /cvsroot/src/tests/fs/tmpfs/t_vnode_leak.sh,v
retrieving revision 1.6
diff -u -r1.6 t_vnode_leak.sh
--- fs/tmpfs/t_vnode_leak.sh 7 Nov 2010 17:51:18 -0000 1.6
+++ fs/tmpfs/t_vnode_leak.sh 14 Jan 2017 04:32:12 -0000
@@ -36,7 +36,7 @@
}
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))
--Apple-Mail=_8E9538A0-C2C0-4471-A6F6-61041E4274BD--
Home |
Main Index |
Thread Index |
Old Index