aboutsummaryrefslogtreecommitdiff
path: root/brillo
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-01-19 17:59:14 -0800
committerAlex Deymo <deymo@google.com>2016-01-19 17:59:14 -0800
commit77edc5357e1ff2c507a07d4c97f943910609ee44 (patch)
treed7333405c45a0a0faf3a4de5be107202e7407b14 /brillo
parentd671746a66d87edf9598cfbe077b3430e50a09d3 (diff)
downloadlibbrillo-77edc5357e1ff2c507a07d4c97f943910609ee44.tar.gz
Disable binder detection for the host.
When building for the host, disable the binder file descriptor detection workaround since we don't use binder on the host and the required modules are not always available. Bug: None TEST=`mmma external/libbrillo` on linux and mac. Change-Id: I36e2786ff036bc3cd01780ae50c242baf407a0a8
Diffstat (limited to 'brillo')
-rw-r--r--brillo/message_loops/base_message_loop.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/brillo/message_loops/base_message_loop.cc b/brillo/message_loops/base_message_loop.cc
index 49dba40..1886569 100644
--- a/brillo/message_loops/base_message_loop.cc
+++ b/brillo/message_loops/base_message_loop.cc
@@ -5,11 +5,16 @@
#include <brillo/message_loops/base_message_loop.h>
#include <fcntl.h>
-#include <linux/major.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#ifndef __ANDROID_HOST__
+// Used for MISC_MAJOR. Only required for the target and not always available
+// for the host.
+#include <linux/major.h>
+#endif
+
#include <vector>
#include <base/bind.h>
@@ -128,6 +133,7 @@ MessageLoop::TaskId BaseMessageLoop::WatchFileDescriptor(
return MessageLoop::kTaskIdNull;
}
+#ifndef __ANDROID_HOST__
// Determine if the passed fd is the binder file descriptor. For that, we need
// to check that is a special char device and that the major and minor device
// numbers match. The binder file descriptor can't be removed and added back
@@ -143,6 +149,7 @@ MessageLoop::TaskId BaseMessageLoop::WatchFileDescriptor(
minor(buf.st_rdev) == GetBinderMinor()) {
it_bool.first->second.RunImmediately();
}
+#endif
return task_id;
}