diff options
author | Patrik Nyblom <[email protected]> | 2012-03-20 18:48:34 +0100 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2012-03-22 18:16:15 +0100 |
commit | ee14f5a400b94b7ded000d7d3dc4c47c9ce1d315 (patch) | |
tree | 5b1584ea13b2d6ca177d8b6b40c33afcc219225f | |
parent | 6969ae73662f7c507977a9560a858a5964c791c4 (diff) | |
download | otp-ee14f5a400b94b7ded000d7d3dc4c47c9ce1d315.tar.gz otp-ee14f5a400b94b7ded000d7d3dc4c47c9ce1d315.tar.bz2 otp-ee14f5a400b94b7ded000d7d3dc4c47c9ce1d315.zip |
Remove code causing dialyzer warning from prim_file
-rw-r--r-- | erts/preloaded/ebin/prim_file.beam | bin | 40672 -> 40608 bytes | |||
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 15 |
2 files changed, 5 insertions, 10 deletions
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam Binary files differindex a62a461146..6400cda2b5 100644 --- a/erts/preloaded/ebin/prim_file.beam +++ b/erts/preloaded/ebin/prim_file.beam diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 8d6ec96f33..0ecb720726 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -268,7 +268,7 @@ advise(#file_descriptor{module = ?MODULE, data = {Port, _}}, %% Returns {error, Reason} | ok. write(#file_descriptor{module = ?MODULE, data = {Port, _}}, Bytes) -> - case drv_command_nt(Port, [?FILE_WRITE,erlang:dt_prepend_vm_tag_data(Bytes)],false,undefined) of + case drv_command_nt(Port, [?FILE_WRITE,erlang:dt_prepend_vm_tag_data(Bytes)],undefined) of {ok, _Size} -> ok; Error -> @@ -284,7 +284,7 @@ pwrite_int(_, [], 0, [], []) -> ok; pwrite_int(Port, [], N, Spec, Data) -> Header = list_to_binary([?FILE_PWRITEV, erlang:dt_prepend_vm_tag_data(<<N:32>>) | reverse(Spec)]), - case drv_command_nt(Port, [Header | reverse(Data)], false, undefined) of + case drv_command_nt(Port, [Header | reverse(Data)], undefined) of {ok, _Size} -> ok; Error -> @@ -402,7 +402,7 @@ pread(#file_descriptor{module = ?MODULE, data = {Port, _}}, L) pread_int(_, [], 0, []) -> {ok, []}; pread_int(Port, [], N, Spec) -> - drv_command_nt(Port, [?FILE_PREADV, erlang:dt_prepend_vm_tag_data(<<0:32, N:32>>) | reverse(Spec)],false, undefined); + drv_command_nt(Port, [?FILE_PREADV, erlang:dt_prepend_vm_tag_data(<<0:32, N:32>>) | reverse(Spec)],undefined); pread_int(Port, [{Offs, Size} | T], N, Spec) when is_integer(Offs), is_integer(Size), 0 =< Size -> if @@ -425,7 +425,7 @@ pread(#file_descriptor{module = ?MODULE, data = {Port, _}}, Offs, Size) Size < ?LARGEFILESIZE -> case drv_command_nt(Port, [?FILE_PREADV, erlang:dt_prepend_vm_tag_data(<<0:32, 1:32, - Offs:64/signed, Size:64>>)], false, undefined) of + Offs:64/signed, Size:64>>)], undefined) of {ok, [eof]} -> eof; {ok, [Data]} -> @@ -990,17 +990,12 @@ drv_command({Driver, Portopts}, Command, Validated, R) -> Error -> Error end. -drv_command_nt(Port, Command, Validated, R) when is_port(Port) -> +drv_command_nt(Port, Command, R) when is_port(Port) -> Save = erlang:dt_spread_tag(false), try erlang:port_command(Port, Command) of true -> drv_get_response(Port, R) catch - %% If the Command is valid, knowing that the port is a port, - %% a badarg error must mean it is a dead port, that is: - %% a currently invalid filehandle, -> einval, not badarg. - error:badarg when Validated -> - {error, einval}; error:badarg -> try erlang:iolist_size(Command) of _ -> % Valid |