diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index c4066259dfb..0d233968e56 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -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(sizeof(struct sockaddr_storage)); if (getpeername(fd, reinterpret_cast(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;