From 604967b4c184249d8604f327bb4e683e2c453de8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 6 Jul 2011 16:58:04 +0200 Subject: 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 --- erts/emulator/sys/unix/sys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/emulator/sys/unix/sys.c') 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; + } -- cgit v1.2.3 From a27dbff4ba4313b28bdfa132d6120e4b71d5986d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 16 Sep 2011 16:00:30 +0200 Subject: erts: Remove compiler warning in sys.c --- erts/emulator/sys/unix/sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/sys/unix/sys.c') diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index cc08c1d20a..e5ee0df7fa 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -3087,10 +3087,10 @@ 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; + erts_smp_rwmtx_init(&environ_rwmtx, "environ"); + i = 1; ASSERT(argc && argv); -- cgit v1.2.3