Date: Thu, 13 Oct 2016 07:32:25 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307196 - head/contrib/netbsd-tests/fs/tmpfs Message-ID: <201610130732.u9D7WPBN018874@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Thu Oct 13 07:32:25 2016 New Revision: 307196 URL: https://svnweb.freebsd.org/changeset/base/307196 Log: Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD - Add inttypes.h #include for PRId64 macro - Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter. Use sizeof(fhandle_t) instead as the size of fhp is always fixed as fhandle_t, unlike NetBSD's copy of fhp, which is void*. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Modified: head/contrib/netbsd-tests/fs/tmpfs/h_tools.c ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Oct 13 07:25:18 2016 (r307195) +++ head/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Oct 13 07:32:25 2016 (r307196) @@ -50,6 +50,10 @@ #include <string.h> #include <unistd.h> +#ifdef __FreeBSD__ +#include <inttypes.h> +#endif + /* --------------------------------------------------------------------- */ static int getfh_main(int, char **); @@ -70,7 +74,12 @@ getfh_main(int argc, char **argv) if (argc < 2) return EXIT_FAILURE; +#ifdef __FreeBSD__ + fh_size = sizeof(fhandle_t); +#else fh_size = 0; +#endif + fh = NULL; for (;;) { if (fh_size) { @@ -85,7 +94,11 @@ getfh_main(int argc, char **argv) * but it may change if someone moves things around, * so retry untill we have enough memory. */ +#ifdef __FreeBSD__ + error = getfh(argv[1], fh); +#else error = getfh(argv[1], fh, &fh_size); +#endif if (error == 0) { break; } else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610130732.u9D7WPBN018874>