diff options
author | Björn Gustavsson <[email protected]> | 2013-02-05 09:13:41 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-11 14:08:46 +0100 |
commit | b00651f9701f6d352b270af3700abce0e65aa5b6 (patch) | |
tree | 3c4eae19b479d024ec0c6624b7356b06a4a93ef1 /erts/preloaded/src/erl_prim_loader.erl | |
parent | 0aed93263414750a63d65908599ca2e73943b0a7 (diff) | |
download | otp-b00651f9701f6d352b270af3700abce0e65aa5b6.tar.gz otp-b00651f9701f6d352b270af3700abce0e65aa5b6.tar.bz2 otp-b00651f9701f6d352b270af3700abce0e65aa5b6.zip |
prim_file: Always open non-file ports in binary mode
Ports for operations that did not directly operate on a file (such
as listing the files in a directory) was always opened in a binary
mode, but there was still code that supported such port opened in
non-binary mode.
Since we are about to update the code reading directories, and we
don't want to bother we supporting non-binary ports, make sure that
we force the use of binary mode.
Diffstat (limited to 'erts/preloaded/src/erl_prim_loader.erl')
-rw-r--r-- | erts/preloaded/src/erl_prim_loader.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl index d36fdeba3f..c2fac8c0fc 100644 --- a/erts/preloaded/src/erl_prim_loader.erl +++ b/erts/preloaded/src/erl_prim_loader.erl @@ -149,7 +149,7 @@ start_it("inet", Id, Pid, Hosts) -> start_it("efile", Id, Pid, _Hosts) -> process_flag(trap_exit, true), - {ok, Port} = prim_file:open([binary]), + {ok, Port} = prim_file:start(), init_ack(Pid), MultiGet = case erlang:system_info(thread_pool_size) of 0 -> false; @@ -434,7 +434,7 @@ efile_multi_get_file_from_port2(_MFs, 0, _Max, State, _Paths, _Fun, _Ref, Ret) - efile_par_get_file(Ref, State, {Mod,File} = MF, Paths, Pid, Fun) -> %% One port for each file read in "parallel": - case prim_file:open([binary]) of + case prim_file:start() of {ok, Port} -> Port0 = State#state.data, State1 = State#state{data = Port}, |