aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/erlexec.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-05-09 13:30:59 +0200
committerBjörn Gustavsson <[email protected]>2011-05-11 12:23:58 +0200
commit418d08ee5ac108d47940516e62580c9393395c4d (patch)
treec460e4b1c0d8d526eb317076bf3c176fac9e6d7d /erts/etc/common/erlexec.c
parentea7b192ef727ad5dac64df22f3c4a74288608b22 (diff)
downloadotp-418d08ee5ac108d47940516e62580c9393395c4d.tar.gz
otp-418d08ee5ac108d47940516e62580c9393395c4d.tar.bz2
otp-418d08ee5ac108d47940516e62580c9393395c4d.zip
erlexec: Make ERL_<version>_FLAGS behave like ERL_AFLAGS
The contents of the ERL_<version>_FLAGS undocumented environment variable would be added at the end of the command line passed to the BEAM emualator (similar to ERL_ZFLAGS), making it impossible to override (for example) "-smp" with "-smp disable" on the command line. To allow overriding, put the contents of ERL_<version>_FLAGS at the beginning of the command line (similar to ERL_AFLAGS). Since the ERL_<version>_FLAGS variable is undocumented and unsupported, it is OK to change its behaviour in a minor release.
Diffstat (limited to 'erts/etc/common/erlexec.c')
-rw-r--r--erts/etc/common/erlexec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 90c19f66f8..90d3be9448 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -1975,6 +1975,11 @@ initial_argv_massage(int *argc, char ***argv)
*/
vix = 0;
+
+ av = build_args_from_env("ERL_" OTP_SYSTEM_VERSION "_FLAGS");
+ if (av)
+ avv[vix++].argv = av;
+
av = build_args_from_env("ERL_AFLAGS");
if (av)
avv[vix++].argv = av;
@@ -1989,10 +1994,6 @@ initial_argv_massage(int *argc, char ***argv)
if (av)
avv[vix++].argv = av;
- av = build_args_from_env("ERL_" OTP_SYSTEM_VERSION "_FLAGS");
- if (av)
- avv[vix++].argv = av;
-
av = build_args_from_env("ERL_ZFLAGS");
if (av)
avv[vix++].argv = av;