aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-07-06 16:58:04 +0200
committerLukas Larsson <[email protected]>2011-07-08 12:11:12 +0200
commit604967b4c184249d8604f327bb4e683e2c453de8 (patch)
treeec317b5893815ec80d011d573f84883bd15b446c
parent8cbb946298060e4a99015baf5074607992892e76 (diff)
downloadotp-604967b4c184249d8604f327bb4e683e2c453de8.tar.gz
otp-604967b4c184249d8604f327bb4e683e2c453de8.tar.bz2
otp-604967b4c184249d8604f327bb4e683e2c453de8.zip
Move init of smp rw mutex from init to sys_args to make sure that it is initialized before the first erts_sys_getenv call
-rw-r--r--erts/emulator/sys/unix/sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index bafbbb0f6c..cc08c1d20a 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -527,7 +527,6 @@ erts_sys_pre_init(void)
void
erl_sys_init(void)
{
- erts_smp_rwmtx_init(&environ_rwmtx, "environ");
#if !DISABLE_VFORK
{
int res;
@@ -3088,6 +3087,8 @@ get_value(char* rest, char** argv, int* ip)
void
erl_sys_args(int* argc, char** argv)
{
+ erts_smp_rwmtx_init(&environ_rwmtx, "environ");
+
int i, j;
i = 1;
@@ -3151,4 +3152,5 @@ erl_sys_args(int* argc, char** argv)
argv[j++] = argv[i];
}
*argc = j;
+
}