From 7ab33f49185d5a416198f1e0bf5a2ca9f347bbac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 10 Dec 2009 10:21:55 +0100 Subject: Change the expected return value for on_load functions An on_load function is supposed to return 'true' to indicate that the module should be loaded, and 'false' if it should be unloaded. But returning any other term, as well as causing an exception, will also unload the module. Since we don't like boolean values mixed with other values, change the expected return value as follows: * If 'ok' is returned, the module will remain loaded and become callable. * If any other value is returned (or an exception is generated), the module will be unloaded. Also, if the returned value is not an atom, send a warning message to the error_logger (using error_logger:warning_msg/2). The new interpretation of the return value means that an on_load function can now directly return the return value from erlang:load_nif/2. --- erts/preloaded/ebin/init.beam | Bin 44460 -> 44460 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'erts/preloaded/ebin/init.beam') diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam index 7b6bafd1af..be1f71e6c5 100644 Binary files a/erts/preloaded/ebin/init.beam and b/erts/preloaded/ebin/init.beam differ -- cgit v1.2.3