From 58e677929fd423df1885041a1a01c36431872696 Mon Sep 17 00:00:00 2001 From: Primiano Tucci Date: Thu, 12 Oct 2023 15:27:53 +0100 Subject: [PATCH] Fix traced_relay build on Mac os Bug: 284258446 Change-Id: I2cc5a78ea936306a12b3491fd97d7aa5cd5abbdd --- src/traced_relay/relay_service.cc | 3 +++ src/traced_relay/socket_relay_handler.cc | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/traced_relay/relay_service.cc b/src/traced_relay/relay_service.cc index 4b1dc6b583..1ef5855a2a 100644 --- a/src/traced_relay/relay_service.cc +++ b/src/traced_relay/relay_service.cc @@ -70,7 +70,10 @@ void RelayService::OnNewIncomingConnection( IPCFrame ipc_frame; ipc_frame.set_request_id(0); auto* set_peer_identity = ipc_frame.mutable_set_peer_identity(); +#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ + PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) set_peer_identity->set_pid(server_conn->peer_pid_linux()); +#endif set_peer_identity->set_uid( static_cast(server_conn->peer_uid_posix())); diff --git a/src/traced_relay/socket_relay_handler.cc b/src/traced_relay/socket_relay_handler.cc index 2930c86211..e8aa556341 100644 --- a/src/traced_relay/socket_relay_handler.cc +++ b/src/traced_relay/socket_relay_handler.cc @@ -29,7 +29,6 @@ #include "perfetto/ext/base/thread_checker.h" #include "perfetto/ext/base/utils.h" #include "perfetto/ext/base/watchdog.h" -#include "perfetto/ext/base/watchdog_posix.h" namespace perfetto { namespace { @@ -52,8 +51,8 @@ FdPoller::FdPoller(Watcher* watcher) : watcher_(watcher) { void FdPoller::Poll() { PERFETTO_DCHECK_THREAD(thread_checker_); - int num_fds = - PERFETTO_EINTR(poll(&poll_fds_[0], poll_fds_.size(), kPollTimeoutMs)); + int num_fds = PERFETTO_EINTR(poll( + &poll_fds_[0], static_cast(poll_fds_.size()), kPollTimeoutMs)); if (num_fds == -1 && base::IsAgain(errno)) return; // Poll again. PERFETTO_DCHECK(num_fds <= static_cast(poll_fds_.size()));