Skip to content

Commit

Permalink
Fix traced_relay build on Mac os
Browse files Browse the repository at this point in the history
Bug: 284258446
Change-Id: I2cc5a78ea936306a12b3491fd97d7aa5cd5abbdd
  • Loading branch information
primiano committed Oct 12, 2023
1 parent 0bb49ab commit 58e6779
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/traced_relay/relay_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t>(server_conn->peer_uid_posix()));

Expand Down
5 changes: 2 additions & 3 deletions src/traced_relay/socket_relay_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<nfds_t>(poll_fds_.size()), kPollTimeoutMs));
if (num_fds == -1 && base::IsAgain(errno))
return; // Poll again.
PERFETTO_DCHECK(num_fds <= static_cast<int>(poll_fds_.size()));
Expand Down

0 comments on commit 58e6779

Please sign in to comment.