mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
libnv: let nvlist_recv() pass flags to recv()
Differential Revision: https://reviews.freebsd.org/D32721
This commit is contained in:
parent
d49b75d0d6
commit
db158b9942
|
@ -450,7 +450,7 @@ buf_send(int sock, void *buf, size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
buf_recv(int sock, void *buf, size_t size)
|
buf_recv(int sock, void *buf, size_t size, int flags)
|
||||||
{
|
{
|
||||||
ssize_t done;
|
ssize_t done;
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
|
@ -461,7 +461,7 @@ buf_recv(int sock, void *buf, size_t size)
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
fd_wait(sock, true);
|
fd_wait(sock, true);
|
||||||
done = recv(sock, ptr, size, 0);
|
done = recv(sock, ptr, size, flags);
|
||||||
if (done == -1) {
|
if (done == -1) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -47,6 +47,6 @@ int fd_send(int sock, const int *fds, size_t nfds);
|
||||||
int fd_recv(int sock, int *fds, size_t nfds);
|
int fd_recv(int sock, int *fds, size_t nfds);
|
||||||
|
|
||||||
int buf_send(int sock, void *buf, size_t size);
|
int buf_send(int sock, void *buf, size_t size);
|
||||||
int buf_recv(int sock, void *buf, size_t size);
|
int buf_recv(int sock, void *buf, size_t size, int flags);
|
||||||
|
|
||||||
#endif /* !_MSGIO_H_ */
|
#endif /* !_MSGIO_H_ */
|
||||||
|
|
|
@ -1280,7 +1280,7 @@ nvlist_recv(int sock, int flags)
|
||||||
size_t nfds, size, i;
|
size_t nfds, size, i;
|
||||||
int *fds;
|
int *fds;
|
||||||
|
|
||||||
if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1)
|
if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr), 0) == -1)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if (!nvlist_check_header(&nvlhdr))
|
if (!nvlist_check_header(&nvlhdr))
|
||||||
|
@ -1298,7 +1298,7 @@ nvlist_recv(int sock, int flags)
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
fds = NULL;
|
fds = NULL;
|
||||||
|
|
||||||
if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr)) == -1)
|
if (buf_recv(sock, buf + sizeof(nvlhdr), size - sizeof(nvlhdr), 0) == -1)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (nfds > 0) {
|
if (nfds > 0) {
|
||||||
|
|
Loading…
Reference in a new issue