aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2015-05-20 09:52:49 +0200
committerHenrik Nord <[email protected]>2015-05-20 09:52:53 +0200
commit1de6eedabd5b83d8996b5ad1a87c60a014b26c5b (patch)
treee2f94f54f21a7e584370e2214290cad53fd02661 /erts/emulator
parentd98543abfecba250cddaa22dca39cc63b5f57cd7 (diff)
parent2652fc4c4a5be4cf3849f18d5e97398ec38f9d99 (diff)
downloadotp-1de6eedabd5b83d8996b5ad1a87c60a014b26c5b.tar.gz
otp-1de6eedabd5b83d8996b5ad1a87c60a014b26c5b.tar.bz2
otp-1de6eedabd5b83d8996b5ad1a87c60a014b26c5b.zip
Merge branch 'mikpe/erl_child_setup-android-breakage'
* mikpe/erl_child_setup-android-breakage: erl_child_setup.c: fix Android breakage OTP-12751
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/sys/unix/erl_child_setup.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c
index 5ad92dad02..d050748703 100644
--- a/erts/emulator/sys/unix/erl_child_setup.c
+++ b/erts/emulator/sys/unix/erl_child_setup.c
@@ -55,7 +55,7 @@ void sys_sigrelease(int sig)
#endif /* !SIG_SIGSET */
#if defined(__ANDROID__)
-int __system_properties_fd(void);
+static int system_properties_fd(void);
#endif /* __ANDROID__ */
#if defined(__ANDROID__)
@@ -104,9 +104,12 @@ main(int argc, char *argv[])
#if defined(HAVE_CLOSEFROM)
closefrom(from);
#elif defined(__ANDROID__)
- for (i = from; i <= to; i++) {
- if (i!=__system_properties_fd)
- (void) close(i);
+ if (from <= to) {
+ int spfd = system_properties_fd();
+ for (i = from; i <= to; i++) {
+ if (i != spfd)
+ (void) close(i);
+ }
}
#else
for (i = from; i <= to; i++)
@@ -143,9 +146,9 @@ main(int argc, char *argv[])
}
#if defined(__ANDROID__)
-int __system_properties_fd(void)
+static int system_properties_fd(void)
{
- int s, fd;
+ int fd;
char *env;
env = getenv("ANDROID_PROPERTY_WORKSPACE");
@@ -156,4 +159,3 @@ int __system_properties_fd(void)
return fd;
}
#endif /* __ANDROID__ */
-