aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/ose/erl_main.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-14 18:18:12 +0100
committerLukas Larsson <[email protected]>2014-02-24 15:16:02 +0100
commit809ee10f37bac29b3056f4fb09c072b951e29f0c (patch)
tree1dc318e88d8b791bb99865bcc58378f8c59bbd46 /erts/emulator/sys/ose/erl_main.c
parent455f6ea4f04a2289f3ee6b39cdd415513a42f759 (diff)
downloadotp-809ee10f37bac29b3056f4fb09c072b951e29f0c.tar.gz
otp-809ee10f37bac29b3056f4fb09c072b951e29f0c.tar.bz2
otp-809ee10f37bac29b3056f4fb09c072b951e29f0c.zip
ose: Fix starting with pm_create
For some reason starting with pm_create offsets the input argument list by one, so we have to adjust them before calling erl_start.
Diffstat (limited to 'erts/emulator/sys/ose/erl_main.c')
-rw-r--r--erts/emulator/sys/ose/erl_main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/erts/emulator/sys/ose/erl_main.c b/erts/emulator/sys/ose/erl_main.c
index a17fc7eabc..03119c3fec 100644
--- a/erts/emulator/sys/ose/erl_main.c
+++ b/erts/emulator/sys/ose/erl_main.c
@@ -17,8 +17,16 @@
* %CopyrightEnd%
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <stdlib.h>
+#include "sys.h"
+#include "erl_vm.h"
+#include "global.h"
+#include "ose.h"
+
int
main(int argc, char **argv) {
@@ -30,8 +38,8 @@ main(int argc, char **argv) {
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);
+ tmp_argv[0] = "beam";
+ erl_start(argc+1,tmp_argv);
free(tmp_argv);
} else {
erl_start(argc,argv);