Skip to content

Commit

Permalink
[29.0.6] fix build compile error on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
prife committed Jan 30, 2021
1 parent 1a02174 commit 8a41eee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/liblog/logd_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ pid_t gettid() {
}
#endif

#if defined(__APPLE__)
#include <android-base/macros.h>
#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) {
Expand Down

0 comments on commit 8a41eee

Please sign in to comment.