aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/src/procattr.c
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2016-11-23 18:47:10 -0800
committerStephen Smalley <sds@tycho.nsa.gov>2016-11-28 09:32:21 -0500
commit044f6ef104c8a9d8f42faa8756e71a0525198f5b (patch)
tree9b2965c6a350c6724082d85c443dda28b9d3aec9 /libselinux/src/procattr.c
parentbb96e1305d8c70150ef5e0946b8c82a49536622a (diff)
downloadandroid_external_selinux-044f6ef104c8a9d8f42faa8756e71a0525198f5b.tar.gz
android_external_selinux-044f6ef104c8a9d8f42faa8756e71a0525198f5b.tar.bz2
android_external_selinux-044f6ef104c8a9d8f42faa8756e71a0525198f5b.zip
procattr.c: Use __ANDROID__ instead of ANDROID
When code is compiled within the Android tree, the resulting binaries are intended to run either on the "host" (the machine doing the building) or the "target" (the machine running the Android operating system). "ANDROID" is defined if the code is being compiled for the host or the target, whereas "__ANDROID__" is only defined for code being compiled for the target. (yes, I agree, this is not obvious). gettid() is only declared in the target environment, not the host environment, so adjust the #ifdef to properly emit the gettid() definition for binaries targeting the host. Signed-off-by: Nick Kralevich <nnk@google.com>
Diffstat (limited to 'libselinux/src/procattr.c')
-rw-r--r--libselinux/src/procattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libselinux/src/procattr.c b/libselinux/src/procattr.c
index 7efcd7e1..8cd59af5 100644
--- a/libselinux/src/procattr.c
+++ b/libselinux/src/procattr.c
@@ -22,7 +22,7 @@ static pthread_key_t destructor_key;
static int destructor_key_initialized = 0;
static __thread char destructor_initialized;
-#ifndef ANDROID
+#ifndef __ANDROID__
/* Android declares this in unistd.h and has a definition for it */
static pid_t gettid(void)
{