aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code_server.erl
diff options
context:
space:
mode:
authorTuncer Ayaz <[email protected]>2011-09-01 18:10:41 +0200
committerTuncer Ayaz <[email protected]>2012-07-06 17:01:02 +0200
commit449a093a22af91403c36ca45c620d648d9110ab5 (patch)
treebd14241b3f7aadc92047c42c84a1181f257f409e /lib/kernel/src/code_server.erl
parentc075ac6484e3d5a93a0d870ab4483d39ae26eaec (diff)
downloadotp-449a093a22af91403c36ca45c620d648d9110ab5.tar.gz
otp-449a093a22af91403c36ca45c620d648d9110ab5.tar.bz2
otp-449a093a22af91403c36ca45c620d648d9110ab5.zip
[erts,kernel,stdlib] fix escript/primary archive reloading
If the mtime of an escript/primary archive file changes after being added to the code path, correctly reload the archive and update the cache. The existing code didn't consider that it might be a zip archive and failed: =ERROR REPORT==== 3-Aug-2011::09:21:21 === File operation error: bad_central_directory. Target: /escript_archive/module.beam. Function: get_file. Process: code_server. Thanks David Reid and Hakan Mattson.
Diffstat (limited to 'lib/kernel/src/code_server.erl')
-rw-r--r--lib/kernel/src/code_server.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index a2db7c9790..00ad923466 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -394,8 +394,8 @@ handle_call(stop,{_From,_Tag}, S) ->
handle_call({is_cached,_File}, {_From,_Tag}, S=#state{cache=no_cache}) ->
{reply, no, S};
-handle_call({set_primary_archive, File, ArchiveBin, FileInfo}, {_From,_Tag}, S=#state{mode=Mode}) ->
- case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo) of
+handle_call({set_primary_archive, File, ArchiveBin, FileInfo, ParserFun}, {_From,_Tag}, S=#state{mode=Mode}) ->
+ case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo, ParserFun) of
{ok, Files} ->
{reply, {ok, Mode, Files}, S};
{error, _Reason} = Error ->