Skip to content

Commit

Permalink
Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later."
Browse files Browse the repository at this point in the history
  • Loading branch information
enh-google authored and Gerrit Code Review committed Aug 23, 2016
2 parents 40eff95 + 874c674 commit 82b67ff
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions debuggerd/debuggerd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ static int read_request(int fd, debugger_request_t* out_request) {
}

ALOGV("reading tid");
fcntl(fd, F_SETFL, O_NONBLOCK);

pollfd pollfds[1];
pollfds[0].fd = fd;
pollfds[0].events = POLLIN;
Expand Down Expand Up @@ -828,7 +826,7 @@ static int do_server() {
socklen_t alen = sizeof(ss);

ALOGV("waiting for connection\n");
int fd = accept4(s, addrp, &alen, SOCK_CLOEXEC);
int fd = accept4(s, addrp, &alen, SOCK_CLOEXEC | SOCK_NONBLOCK);
if (fd == -1) {
ALOGE("accept failed: %s\n", strerror(errno));
continue;
Expand Down

0 comments on commit 82b67ff

Please sign in to comment.