aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/erlexec.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-05-05 10:49:26 +0200
committerBjörn Gustavsson <[email protected]>2011-05-11 12:23:46 +0200
commitf587cbbb739fc2318d3e2f824d3df271028f9c41 (patch)
treea54f25f006d0d391931ba6f35e01b047ba8db494 /erts/etc/common/erlexec.c
parent8ca1414cf245e53e638ef53f28661ac574fee6cc (diff)
downloadotp-f587cbbb739fc2318d3e2f824d3df271028f9c41.tar.gz
otp-f587cbbb739fc2318d3e2f824d3df271028f9c41.tar.bz2
otp-f587cbbb739fc2318d3e2f824d3df271028f9c41.zip
Teach erlexec the -emu_name_exit option
It is difficult/impossible to find out whether an invocation of 'erl' will start the smp emulator or the non-smp emulator (short of actually starting the emulator). Therefore we will need a way to ask 'erlexec'.
Diffstat (limited to 'erts/etc/common/erlexec.c')
-rw-r--r--erts/etc/common/erlexec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 60b3af7db7..90c19f66f8 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -394,6 +394,7 @@ int main(int argc, char **argv)
int print_args_exit = 0;
int print_qouted_cmd_exit = 0;
erts_cpu_info_t *cpuinfo = NULL;
+ char* emu_name;
#ifdef __WIN32__
this_module_handle = module;
@@ -566,6 +567,7 @@ int main(int argc, char **argv)
usage("+MYm");
}
emu = add_extra_suffixes(emu, emu_type);
+ emu_name = strsave(emu);
erts_snprintf(tmpStr, sizeof(tmpStr), "%s" DIRSEP "%s" BINARY_EXT, bindir, emu);
emu = strsave(tmpStr);
@@ -682,6 +684,9 @@ int main(int argc, char **argv)
verbose = 1;
} else if (strcmp(argv[i], "-emu_args_exit") == 0) {
print_args_exit = 1;
+ } else if (strcmp(argv[i], "-emu_name_exit") == 0) {
+ printf("%s\n", emu_name);
+ exit(0);
} else if (strcmp(argv[i], "-emu_qouted_cmd_exit") == 0) {
print_qouted_cmd_exit = 1;
} else if (strcmp(argv[i], "-env") == 0) { /* -env VARNAME VARVALUE */