From 8a41eee3dfe788de95777a6524d5d1be560e4514 Mon Sep 17 00:00:00 2001 From: zhongkaizhu Date: Sat, 30 Jan 2021 23:13:17 +0800 Subject: [PATCH] [29.0.6] fix build compile error on macOS --- lib/liblog/logd_writer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/liblog/logd_writer.cpp b/lib/liblog/logd_writer.cpp index 51e7098..64fa182 100644 --- a/lib/liblog/logd_writer.cpp +++ b/lib/liblog/logd_writer.cpp @@ -65,6 +65,17 @@ pid_t gettid() { } #endif +#if defined(__APPLE__) +#include +#ifndef SOCK_CLOEXEC +#define SOCK_CLOEXEC 0 +#endif + +#ifndef SOCK_NONBLOCK +#define SOCK_NONBLOCK 0 +#endif +#endif + static void OpenSocketLocked() { logd_socket = TEMP_FAILURE_RETRY(socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)); if (logd_socket <= 0) {