diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-09 12:07:59 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-09 12:07:59 -0200 |
commit | baeac042059786f1ed0cca7ca4a4a32721362cab (patch) | |
tree | 3b848bddaf0f478d0c0651c8ee62129d3d9bacf5 /contrib/netbsd-tests/fs/tmpfs/h_tools.c | |
parent | 1af1408e09373ae856cfef567d79849c7e7e0d25 (diff) | |
parent | f91948fdd5322d9aae1e8785976df69612c1999f (diff) | |
download | FreeBSD-src-baeac042059786f1ed0cca7ca4a4a32721362cab.zip FreeBSD-src-baeac042059786f1ed0cca7ca4a4a32721362cab.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'contrib/netbsd-tests/fs/tmpfs/h_tools.c')
-rw-r--r-- | contrib/netbsd-tests/fs/tmpfs/h_tools.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/fs/tmpfs/h_tools.c b/contrib/netbsd-tests/fs/tmpfs/h_tools.c index 64abe7b..492e084 100644 --- a/contrib/netbsd-tests/fs/tmpfs/h_tools.c +++ b/contrib/netbsd-tests/fs/tmpfs/h_tools.c @@ -243,12 +243,21 @@ sockets_main(int argc, char **argv) return EXIT_FAILURE; } +#ifdef __FreeBSD__ + memset(&addr, 0, sizeof(addr)); +#endif (void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path)); addr.sun_family = PF_UNIX; - +#ifdef __FreeBSD__ + error = bind(fd, (struct sockaddr *)&addr, SUN_LEN(&addr)); +#else error = bind(fd, (struct sockaddr *)&addr, sizeof(addr)); +#endif if (error == -1) { warn("connect"); +#ifdef __FreeBSD__ + (void)close(fd); +#endif return EXIT_FAILURE; } |