diff options
-rw-r--r-- | libc/dns/net/getaddrinfo.c | 6 | ||||
-rw-r--r-- | libc/dns/resolv/res_init.c | 12 | ||||
-rw-r--r-- | libc/stdio/refill.c | 2 | ||||
-rw-r--r-- | libc/tzcode/localtime.c | 12 | ||||
-rw-r--r-- | libc/tzcode/strftime.c | 2 | ||||
-rw-r--r-- | tests/sys_prctl_test.cpp | 2 |
6 files changed, 19 insertions, 17 deletions
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c index cc8b8b468..13000f7b8 100644 --- a/libc/dns/net/getaddrinfo.c +++ b/libc/dns/net/getaddrinfo.c @@ -108,9 +108,9 @@ #include <stdarg.h> #include "nsswitch.h" -#ifdef ANDROID_CHANGES +#if defined(__BIONIC__) #include <sys/system_properties.h> -#endif /* ANDROID_CHANGES */ +#endif typedef union sockaddr_union { struct sockaddr generic; @@ -325,7 +325,7 @@ freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; -#if __ANDROID__ +#if defined(__BIONIC__) if (ai == NULL) return; #else _DIAGASSERT(ai != NULL); diff --git a/libc/dns/resolv/res_init.c b/libc/dns/resolv/res_init.c index 713b6e015..a5413dd2a 100644 --- a/libc/dns/resolv/res_init.c +++ b/libc/dns/resolv/res_init.c @@ -166,23 +166,23 @@ res_ninit(res_state statp) { /* This function has to be reachable by res_data.c but not publicly. */ int __res_vinit(res_state statp, int preinit) { -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) register FILE *fp; #endif register char *cp, **pp; -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) register int n; #endif char buf[BUFSIZ]; int nserv = 0; /* number of nameserver records read from file */ -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) int haveenv = 0; #endif int havesearch = 0; #ifdef RESOLVSORT int nsort = 0; #endif -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) char *net; #endif int dots; @@ -243,7 +243,9 @@ __res_vinit(res_state statp, int preinit) { statp->nsort = 0; res_setservers(statp, u, nserv); -#if !defined(__ANDROID__) /* IGNORE THE ENVIRONMENT */ +#if defined(__BIONIC__) + /* Ignore the environment. */ +#else /* Allow user to override the local domain definition */ if ((cp = getenv("LOCALDOMAIN")) != NULL) { (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); diff --git a/libc/stdio/refill.c b/libc/stdio/refill.c index 5b0811f6a..a7c4bff82 100644 --- a/libc/stdio/refill.c +++ b/libc/stdio/refill.c @@ -53,7 +53,7 @@ __srefill(FILE *fp) { fp->_r = 0; /* largely a convenience for callers */ -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) /* SysV does not make this test; take it out for compatibility */ if (fp->_flags & __SEOF) return (EOF); diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index cf0fd6b96..adc2f1b94 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -382,7 +382,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend, register int fid; register int stored; register ssize_t nread; -#if !defined(__ANDROID__) +#if !defined(__BIONIC__) register bool doaccess; register char *fullname = lsp->fullname; #endif @@ -397,7 +397,7 @@ tzloadbody(char const *name, struct state *sp, bool doextend, return EINVAL; } -#if defined(__ANDROID__) +#if defined(__BIONIC__) fid = __bionic_open_tzdata(name); #else if (name[0] == ':') @@ -1308,7 +1308,7 @@ tzsetwall(void) } #endif -#if defined(__ANDROID__) +#if defined(__BIONIC__) #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include <sys/_system_properties.h> // For __system_property_serial. #endif @@ -1316,7 +1316,7 @@ tzsetwall(void) static void tzset_unlocked(void) { -#if defined(__ANDROID__) +#if defined(__BIONIC__) // The TZ environment variable is meant to override the system-wide setting. const char* name = getenv("TZ"); @@ -2174,7 +2174,7 @@ mktime_z(struct state *sp, struct tm *tmp) time_t mktime(struct tm *tmp) { -#if __ANDROID__ +#if defined(__BIONIC__) int saved_errno = errno; #endif @@ -2188,7 +2188,7 @@ mktime(struct tm *tmp) t = mktime_tzname(lclptr, tmp, true); unlock(); -#if __ANDROID__ +#if defined(__BIONIC__) errno = (t == -1) ? EOVERFLOW : saved_errno; #endif return t; diff --git a/libc/tzcode/strftime.c b/libc/tzcode/strftime.c index b1e0d1cc6..c05f6b5bd 100644 --- a/libc/tzcode/strftime.c +++ b/libc/tzcode/strftime.c @@ -39,7 +39,7 @@ #include "fcntl.h" #include "locale.h" -#if __ANDROID__ +#if defined(__BIONIC__) /* LP32 had a 32-bit time_t, so we need to work around that here. */ #if defined(__LP64__) diff --git a/tests/sys_prctl_test.cpp b/tests/sys_prctl_test.cpp index 5a563c1de..f1b08c109 100644 --- a/tests/sys_prctl_test.cpp +++ b/tests/sys_prctl_test.cpp @@ -23,7 +23,7 @@ // http://b/20017123. TEST(sys_prctl, bug_20017123) { -#if defined(__ANDROID__) +#if defined(__ANDROID__) // PR_SET_VMA is only available in Android kernels. size_t page_size = static_cast<size_t>(sysconf(_SC_PAGESIZE)); void* p = mmap(NULL, page_size * 3, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT_NE(MAP_FAILED, p); |