Use bindat() only on FreeBSD, where it is available.
This commit is contained in:
parent
b9e8f1c1d8
commit
ddfdba4079
1 changed files with 8 additions and 0 deletions
|
@ -357,11 +357,19 @@ fs_create(void *softc, struct l9p_request *req)
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
if (bindat(fd, s, (struct sockaddr *)&sun,
|
||||
sun.sun_len) < 0) {
|
||||
l9p_respond(req, errno);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (bind(s, (struct sockaddr *)&sun,
|
||||
sun.sun_len) < 0) {
|
||||
l9p_respond(req, errno);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (close(fd) != 0) {
|
||||
l9p_respond(req, errno);
|
||||
|
|
Loading…
Add table
Reference in a new issue