Most accept/accept4 calls in system/core don't actually want the remote address.

So don't write the extra code for it or waste the kernel's time
copying it around.

Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad
This commit is contained in:
Elliott Hughes 2016-08-23 12:50:00 -07:00
parent d9e76537ad
commit db6096e986
1 changed files with 1 additions and 5 deletions

6
lmkd.c
View File

@ -410,9 +410,6 @@ static void ctrl_data_handler(uint32_t events) {
} }
static void ctrl_connect_handler(uint32_t events __unused) { static void ctrl_connect_handler(uint32_t events __unused) {
struct sockaddr_storage ss;
struct sockaddr *addrp = (struct sockaddr *)&ss;
socklen_t alen;
struct epoll_event epev; struct epoll_event epev;
if (ctrl_dfd >= 0) { if (ctrl_dfd >= 0) {
@ -420,8 +417,7 @@ static void ctrl_connect_handler(uint32_t events __unused) {
ctrl_dfd_reopened = 1; ctrl_dfd_reopened = 1;
} }
alen = sizeof(ss); ctrl_dfd = accept(ctrl_lfd, NULL, NULL);
ctrl_dfd = accept(ctrl_lfd, addrp, &alen);
if (ctrl_dfd < 0) { if (ctrl_dfd < 0) {
ALOGE("lmkd control socket accept failed; errno=%d", errno); ALOGE("lmkd control socket accept failed; errno=%d", errno);