From: Matthew Dillon Date: Wed, 8 Feb 2012 23:32:52 +0000 (-0800) Subject: test - Adjust randread to not share file descriptors X-Git-Tag: v3.4.0rc~1239 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/79580b6b91b2d2b38532aa3837ac35f22055f2ab test - Adjust randread to not share file descriptors * Close and reopen the device when randread fork()s so the physical file descriptor is not shared. The vnode will still be shared. * Works around a serialization issue when a file descriptor is shared. --- diff --git a/test/sysperf/randread.c b/test/sysperf/randread.c index f0ce61b519..57ddde1036 100644 --- a/test/sysperf/randread.c +++ b/test/sysperf/randread.c @@ -71,6 +71,8 @@ main(int ac, char **av) for (i = 0; i < nprocs; ++i) { if (fork() == 0) { + close(fd); + fd = open(av[1], O_RDONLY); srandomdev(); for (;;) { long pos = (random() % limit) & ~(off_t)(bytes - 1);