diff options
author | Lukas Larsson <[email protected]> | 2013-10-30 17:56:37 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2014-02-24 15:16:00 +0100 |
commit | a6788ea337a2319a2d1a42ee4618553a1c7765bf (patch) | |
tree | 76bd19e2bf8076a1b19c2e7e0d4215b9469e747e /erts/emulator/sys/ose/erl_main.c | |
parent | d932131754c2bfb2e0539b6419e3d09533fe84e8 (diff) | |
download | otp-a6788ea337a2319a2d1a42ee4618553a1c7765bf.tar.gz otp-a6788ea337a2319a2d1a42ee4618553a1c7765bf.tar.bz2 otp-a6788ea337a2319a2d1a42ee4618553a1c7765bf.zip |
ose: Fix various build environment issues
Diffstat (limited to 'erts/emulator/sys/ose/erl_main.c')
-rw-r--r-- | erts/emulator/sys/ose/erl_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/erts/emulator/sys/ose/erl_main.c b/erts/emulator/sys/ose/erl_main.c index 322058c87b..a17fc7eabc 100644 --- a/erts/emulator/sys/ose/erl_main.c +++ b/erts/emulator/sys/ose/erl_main.c @@ -17,10 +17,25 @@ * %CopyrightEnd% */ +#include <stdlib.h> + int main(int argc, char **argv) { + /* When starting using pm_create -c ARGV="-- -root ..", argv[0] is the first + part of ARGV and not the name of the executable. So we shuffle some + pointers here to make erl_start happy. */ + if (argv[0][0] == '-') { + int i; + char **tmp_argv = malloc(sizeof(char*)*(argc+1)); + for (i = 0; i < argc; i++) + tmp_argv[i+1] = argv[i]; + tmp_argv = "beam"; + erl_start(argc,tmp_argv); + free(tmp_argv); + } else { erl_start(argc,argv); + } stop(current_process()); |