aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-07-29 16:48:53 +0200
committerFredrik Gustafsson <[email protected]>2013-07-29 16:48:53 +0200
commita5fc79292b9b018cd39d104a8cd2e79de141e3ad (patch)
treef8af1499f7cada2e4c1ee2196c8a058ec2c4d703
parent0481ecafa24dc60c6bca8afdda038dc2239c991d (diff)
parent5e0c73fecc31c72f86663bec55819f093151a039 (diff)
downloadotp-a5fc79292b9b018cd39d104a8cd2e79de141e3ad.tar.gz
otp-a5fc79292b9b018cd39d104a8cd2e79de141e3ad.tar.bz2
otp-a5fc79292b9b018cd39d104a8cd2e79de141e3ad.zip
Merge branch 'weisslj/run-erl-redirect-dev-null/OTP-11215' into maint
* weisslj/run-erl-redirect-dev-null/OTP-11215: run_erl: Redirect standard streams to /dev/null
-rw-r--r--erts/etc/unix/run_erl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index 53c779b1be..b69e31f784 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -1142,6 +1142,14 @@ static void daemon_init(void)
sf_close(i);
}
+ /* Necessary on some platforms */
+
+ open("/dev/null", O_RDONLY); /* Order is important! */
+ open("/dev/null", O_WRONLY);
+ open("/dev/null", O_WRONLY);
+
+ errno = 0; /* if set by open */
+
OPEN_SYSLOG();
run_daemon = 1;
}