diff options
author | James Simmons <jsimmons@infradead.org> | 2012-07-16 01:57:59 +0100 |
---|---|---|
committer | James Simmons <jsimmons@infradead.org> | 2012-07-16 01:57:59 +0100 |
commit | e22956a2faa9cf34cec4a471131d50c6be75b0c2 (patch) | |
tree | 711e907ded2c7fd024de24e57073d292296b3fd7 /tools/hv | |
parent | 9491e34defaa03e18241e1e65352eb7c1d7215ed (diff) | |
parent | 49099c4991da3c94773f888aea2e9d27b8a7c6d1 (diff) |
Merge branch 'drm-core-next'
Diffstat (limited to 'tools/hv')
-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 146fd6147e8..d9834b36294 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; } |