Merge "rename uevent_checked_recv to uevent_kernel_multicast_recv"

This commit is contained in:
Nick Kralevich 2011-05-26 10:55:09 -07:00 committed by Android (Google) Code Review
commit 7956d759be
4 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@
extern "C" {
#endif
ssize_t uevent_checked_recv(int socket, void *buffer, size_t length);
ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length);
#ifdef __cplusplus
}

View File

@ -774,7 +774,7 @@ void handle_device_fd()
{
char msg[UEVENT_MSG_LEN+2];
int n;
while ((n = uevent_checked_recv(device_fd, msg, UEVENT_MSG_LEN)) > 0) {
while ((n = uevent_kernel_multicast_recv(device_fd, msg, UEVENT_MSG_LEN)) > 0) {
if(n >= UEVENT_MSG_LEN) /* overflow -- discard */
continue;

View File

@ -24,7 +24,7 @@
/**
* Like recv(), but checks that messages actually originate from the kernel.
*/
ssize_t uevent_checked_recv(int socket, void *buffer, size_t length) {
ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length) {
struct iovec iov = { buffer, length };
struct sockaddr_nl addr;
char control[CMSG_SPACE(sizeof(struct ucred))];

View File

@ -36,7 +36,7 @@ bool NetlinkListener::onDataAvailable(SocketClient *cli)
int socket = cli->getSocket();
ssize_t count;
count = TEMP_FAILURE_RETRY(uevent_checked_recv(socket, mBuffer, sizeof(mBuffer)));
count = TEMP_FAILURE_RETRY(uevent_kernel_multicast_recv(socket, mBuffer, sizeof(mBuffer)));
if (count < 0) {
SLOGE("recvmsg failed (%s)", strerror(errno));
return false;