aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_init.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-09 17:27:52 +0100
committerBjörn Gustavsson <[email protected]>2011-11-14 14:46:58 +0100
commitb67d3e5447f4b2bca3ed92f3db84adb3f79f9b16 (patch)
tree8d8697d0cde6adb6680b64d2d424b739f5df99b2 /erts/emulator/beam/erl_init.c
parent757a4720645366af1aace7469a6f5e7b9be7ab45 (diff)
downloadotp-b67d3e5447f4b2bca3ed92f3db84adb3f79f9b16.tar.gz
otp-b67d3e5447f4b2bca3ed92f3db84adb3f79f9b16.tar.bz2
otp-b67d3e5447f4b2bca3ed92f3db84adb3f79f9b16.zip
BEAM loader: Clean up handling of error reasons
There is no reason to have erts_load_module() return integer values, only to have the caller convert the values to atoms. Return the appropriate atom directly from the place where the error is generated instead. Return NIL if the module was successfully loaded.
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r--erts/emulator/beam/erl_init.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index fd15df731a..7ae9f990ad 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -436,7 +436,7 @@ static void
load_preloaded(void)
{
int i;
- int res;
+ Eterm res;
Preload* preload_p;
Eterm module_name;
byte* code;
@@ -455,8 +455,9 @@ load_preloaded(void)
name);
res = erts_load_module(NULL, 0, NIL, &module_name, code, length);
sys_preload_end(&preload_p[i]);
- if (res < 0)
- erl_exit(1,"Failed loading preloaded module %s\n", name);
+ if (res != NIL)
+ erl_exit(1,"Failed loading preloaded module %s (%T)\n",
+ name, res);
i++;
}
}