25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Change argument of open_port/2 to string in order to shut up the dialyzer

This commit is contained in:
Evgeniy Khramtsov 2011-09-05 15:28:01 +10:00
parent 2434be4803
commit 1994c8a174
7 changed files with 11 additions and 11 deletions

View File

@ -110,7 +110,7 @@ init() ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, expat_erl}, [binary]),
Port = open_port({spawn, "expat_erl"}, [binary]),
loop(Port).

View File

@ -63,7 +63,7 @@ init([]) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, ejabberd_zlib_drv}, [binary]),
Port = open_port({spawn, "ejabberd_zlib_drv"}, [binary]),
{ok, Port}.
@ -99,7 +99,7 @@ enable_zlib(SockMod, Socket) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, ejabberd_zlib_drv}, [binary]),
Port = open_port({spawn, "ejabberd_zlib_drv"}, [binary]),
{ok, #zlibsock{sockmod = SockMod, socket = Socket, zlibport = Port}}.
disable_zlib(#zlibsock{sockmod = SockMod, socket = Socket, zlibport = Port}) ->

View File

@ -52,7 +52,7 @@ init([]) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, iconv_erl}, []),
Port = open_port({spawn, "iconv_erl"}, []),
ets:new(iconv_table, [set, public, named_table]),
ets:insert(iconv_table, {port, Port}),
{ok, Port}.

View File

@ -47,7 +47,7 @@ start() ->
end,
case Res of
ok ->
Port = open_port({spawn, ?DRIVER}, [binary]),
Port = open_port({spawn, atom_to_list(?DRIVER)}, [binary]),
register(?DRIVER, Port);
{error, Reason} ->
?CRITICAL_MSG("unable to load driver '~s': ~s",

View File

@ -60,7 +60,7 @@ init([]) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, stringprep_drv}, []),
Port = open_port({spawn, "stringprep_drv"}, []),
register(?STRINGPREP_PORT, Port),
{ok, Port}.

View File

@ -84,7 +84,7 @@ init([]) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, tls_drv}, [binary]),
Port = open_port({spawn, "tls_drv"}, [binary]),
Res = port_control(Port, ?SET_CERTIFICATE_FILE_ACCEPT, "./ssl.pem" ++ [0]),
case Res of
<<0>> ->
@ -130,7 +130,7 @@ tcp_to_tls(TCPSocket, Options) ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, tls_drv}, [binary]),
Port = open_port({spawn, "tls_drv"}, [binary]),
Flags =
case lists:member(verify_none, Options) of
true ->
@ -267,7 +267,7 @@ test() ->
ok -> ok;
{error, already_loaded} -> ok
end,
Port = open_port({spawn, tls_drv}, [binary]),
Port = open_port({spawn, "tls_drv"}, [binary]),
?PRINT("open_port: ~p~n", [Port]),
PCRes = port_control(Port, ?SET_CERTIFICATE_FILE_ACCEPT,
"./ssl.pem" ++ [0]),

View File

@ -99,7 +99,7 @@ new(CallbackPid) ->
new(CallbackPid, infinity).
new(CallbackPid, MaxSize) ->
Port = open_port({spawn, expat_erl}, [binary]),
Port = open_port({spawn, "expat_erl"}, [binary]),
#xml_stream_state{callback_pid = CallbackPid,
port = Port,
stack = [],
@ -140,7 +140,7 @@ close(#xml_stream_state{port = Port}) ->
parse_element(Str) ->
Port = open_port({spawn, expat_erl}, [binary]),
Port = open_port({spawn, "expat_erl"}, [binary]),
Res = port_control(Port, ?PARSE_FINAL_COMMAND, Str),
port_close(Port),
process_element_events(binary_to_term(Res)).