diff options
author | Siri Hansen <[email protected]> | 2013-04-26 14:21:12 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2013-05-06 12:14:14 +0200 |
commit | 19d41eefa1cf4856587930d99959bbed73a818b5 (patch) | |
tree | 51cbb92f4e3e6ae31d678c26e4f49056f144af2e /lib/sasl/src/systools_relup.erl | |
parent | f52452309cf68da898a1768eb6e8b6767e602bc7 (diff) | |
download | otp-19d41eefa1cf4856587930d99959bbed73a818b5.tar.gz otp-19d41eefa1cf4856587930d99959bbed73a818b5.tar.bz2 otp-19d41eefa1cf4856587930d99959bbed73a818b5.zip |
Fix unmatched_return warnings in sasl
Diffstat (limited to 'lib/sasl/src/systools_relup.erl')
-rw-r--r-- | lib/sasl/src/systools_relup.erl | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/sasl/src/systools_relup.erl b/lib/sasl/src/systools_relup.erl index 716dc2b5ff..b3494542e5 100644 --- a/lib/sasl/src/systools_relup.erl +++ b/lib/sasl/src/systools_relup.erl @@ -523,7 +523,7 @@ to_list(X) when is_atom(X) -> atom_to_list(X); to_list(X) when is_list(X) -> X. -%% write_relup_file(Relup, Opts) -> {ok. Relup} +%% write_relup_file(Relup, Opts) -> ok %% %% Writes a relup file. %% @@ -545,12 +545,17 @@ write_relup_file(Relup, Opts) -> case file:open(Filename, [write]) of {ok, Fd} -> io:format(Fd, "~p.~n", [Relup]), - file:close(Fd); + case file:close(Fd) of + ok -> ok; + {error,Reason} -> + throw({error, ?MODULE, + {file_problem, {"relup", {close,Reason}}}}) + end; {error, Reason} -> - throw({error, ?MODULE, {file_problem, {"relup", Reason}}}) + throw({error, ?MODULE, + {file_problem, {"relup", {open, Reason}}}}) end - end, - {ok, Relup}. + end. add_code_path(Opts) -> case get_opt(path, Opts) of @@ -597,8 +602,6 @@ print_error({error, Mod, Error}) -> print_error(Other) -> io:format("Error: ~p~n", [Other]). -format_error({file_problem, {"relup", _Posix}}) -> - io_lib:format("Could not open file relup~n", []); format_error({file_problem, {File, What}}) -> io_lib:format("Could not ~w file ~ts~n", [get_reason(What), File]); format_error({no_relup, File, App, Vsn}) -> @@ -642,12 +645,14 @@ format_warning(Prefix, What) -> get_reason({error, {open, _, _}}) -> open; get_reason({error, {read, _, _}}) -> read; get_reason({error, {parse, _, _}}) -> parse; +get_reason({error, {close, _, _}}) -> close; get_reason({error, {open, _}}) -> open; get_reason({error, {read, _}}) -> read; get_reason({error, {parse, _}}) -> parse; get_reason({open, _}) -> open; get_reason({read, _}) -> read; get_reason({parse, _}) -> parse; +get_reason({close, _}) -> close; get_reason(open) -> open; get_reason(read) -> read; get_reason(parse) -> parse. |