From 418d08ee5ac108d47940516e62580c9393395c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 9 May 2011 13:30:59 +0200 Subject: erlexec: Make ERL__FLAGS behave like ERL_AFLAGS The contents of the ERL__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__FLAGS at the beginning of the command line (similar to ERL_AFLAGS). Since the ERL__FLAGS variable is undocumented and unsupported, it is OK to change its behaviour in a minor release. --- erts/etc/common/erlexec.c | 9 +++++---- 1 file 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; -- cgit v1.2.3