diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 09:31:00 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-25 09:31:00 -0700 |
commit | bcc66c0b8881f88459f9ac21038455bcafacdc6e (patch) | |
tree | b402e677253c3fc1038ca4a52fc54fc223261133 /tools/hv/hv_kvp_daemon.c | |
parent | 1c1b86215730ef07d8851c2247b9ecf73038d05d (diff) | |
parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) | |
download | linux-bcc66c0b8881f88459f9ac21038455bcafacdc6e.tar.gz linux-bcc66c0b8881f88459f9ac21038455bcafacdc6e.tar.bz2 linux-bcc66c0b8881f88459f9ac21038455bcafacdc6e.zip |
Merge 3.5-rc4 into staging-next
This picks up the staging changes made in 3.5-rc4 so that everyone can sync up
properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv/hv_kvp_daemon.c')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 146fd6147e84..d9834b362943 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c @@ -701,14 +701,18 @@ int main(void) pfd.fd = fd; while (1) { + struct sockaddr *addr_p = (struct sockaddr *) &addr; + socklen_t addr_l = sizeof(addr); pfd.events = POLLIN; pfd.revents = 0; poll(&pfd, 1, -1); - len = recv(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0); + len = recvfrom(fd, kvp_recv_buffer, sizeof(kvp_recv_buffer), 0, + addr_p, &addr_l); - if (len < 0) { - syslog(LOG_ERR, "recv failed; error:%d", len); + if (len < 0 || addr.nl_pid) { + syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s", + addr.nl_pid, errno, strerror(errno)); close(fd); return -1; } |