Skip to content

Commit

Permalink
Update comment following #31108 (#31947)
Browse files Browse the repository at this point in the history
For UNIX sockets, code has been fixed but comment and log were not.
  • Loading branch information
fnadeau authored and wanlin31 committed May 18, 2023
1 parent f8d194c commit c583073
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/lib/iomgr/tcp_server_posix.cc
Expand Up @@ -230,13 +230,13 @@ static void on_read(void* arg, grpc_error_handle err) {
}

// For UNIX sockets, the accept call might not fill up the member sun_path
// of sockaddr_un, so explicitly call getsockname to get it.
// of sockaddr_un, so explicitly call getpeername to get it.
if (grpc_is_unix_socket(&addr)) {
memset(&addr, 0, sizeof(addr));
addr.len = static_cast<socklen_t>(sizeof(struct sockaddr_storage));
if (getpeername(fd, reinterpret_cast<struct sockaddr*>(addr.addr),
&(addr.len)) < 0) {
gpr_log(GPR_ERROR, "Failed getsockname: %s",
gpr_log(GPR_ERROR, "Failed getpeername: %s",
grpc_core::StrError(errno).c_str());
close(fd);
goto error;
Expand Down

0 comments on commit c583073

Please sign in to comment.