aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/erlexec.c
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-04-28 11:48:14 +0200
committerDan Gudmundsson <[email protected]>2017-04-28 11:48:14 +0200
commit86f6a985670008690695b304c6606b054d2f27c3 (patch)
treee491e1714101417aa8a315156209b321d5f64444 /erts/etc/common/erlexec.c
parent9fad2fdd57fafca649a358e9d6b62c061fe6cf27 (diff)
parentfab97e165a79db10b7b560be5aefc7489982bced (diff)
downloadotp-86f6a985670008690695b304c6606b054d2f27c3.tar.gz
otp-86f6a985670008690695b304c6606b054d2f27c3.tar.bz2
otp-86f6a985670008690695b304c6606b054d2f27c3.zip
Merge branch 'dgud/erts/erlscript_name'
* dgud/erts/erlscript_name: Rename argv[0] from beam to invoking program name OTP-14381
Diffstat (limited to 'erts/etc/common/erlexec.c')
-rw-r--r--erts/etc/common/erlexec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 8b75199a1e..f11ec2320a 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -587,8 +587,12 @@ int main(int argc, char **argv)
erts_snprintf(tmpStr, sizeof(tmpStr), "%s" DIRSEP "%s" BINARY_EXT, bindir, emu);
emu = strsave(tmpStr);
- add_Eargs(emu); /* Will be argv[0] -- necessary! */
-
+ s = get_env("ESCRIPT_NAME");
+ if(s) {
+ add_Eargs(s); /* argv[0] = scriptname*/
+ } else {
+ add_Eargs(progname); /* argv[0] = erl or cerl */
+ }
/*
* Add the bindir to the path (unless it is there already).
*/