Clean up some mess by only building Android-specific code for the device.
Test: treehugger
Change-Id: Id44721ccd1817d8c537b226f60a58b7cb691fb01
diff --git a/libcutils/sockets_unix.cpp b/libcutils/sockets_unix.cpp
index 2248817..6acdcd8 100644
--- a/libcutils/sockets_unix.cpp
+++ b/libcutils/sockets_unix.cpp
@@ -16,8 +16,6 @@
#include <cutils/sockets.h>
-#define LOG_TAG "socket-unix"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -27,9 +25,6 @@
#include <time.h>
#include <unistd.h>
-#include <cutils/android_get_control_file.h>
-#include <log/log.h>
-
#include "android_get_control_env.h"
int socket_close(int sock) {
@@ -62,6 +57,7 @@
return writev(sock, iovec_buffers, num_buffers);
}
+#if defined(__ANDROID__)
int android_get_control_socket(const char* name) {
int fd = __android_get_control_from_env(ANDROID_SOCKET_ENV_PREFIX, name);
@@ -82,3 +78,8 @@
}
return -1;
}
+#else
+int android_get_control_socket(const char*) {
+ return -1;
+}
+#endif