diff --git a/contrib/netbsd-tests/lib/libc/gen/t_realpath.c b/contrib/netbsd-tests/lib/libc/gen/t_realpath.c index d4998c7ea265..dfb360f46450 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_realpath.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_realpath.c @@ -34,6 +34,9 @@ __RCSID("$NetBSD: t_realpath.c,v 1.2 2012/03/27 07:54:58 njoly Exp $"); #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -122,8 +125,15 @@ ATF_TC_BODY(realpath_symlink, tc) char resb[MAXPATHLEN] = { 0 }; int fd; +#ifdef __FreeBSD__ + ATF_REQUIRE_MSG(getcwd(path, sizeof(path)) != NULL, + "getcwd(path) failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(getcwd(slnk, sizeof(slnk)) != NULL, + "getcwd(slnk) failed: %s", strerror(errno)); +#else (void)getcwd(path, sizeof(path)); (void)getcwd(slnk, sizeof(slnk)); +#endif (void)strlcat(path, "/realpath", sizeof(path)); (void)strlcat(slnk, "/symbolic", sizeof(slnk));