aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/systools_lib.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-04-26 14:21:12 +0200
committerHans Bolinder <[email protected]>2013-05-06 12:14:14 +0200
commit19d41eefa1cf4856587930d99959bbed73a818b5 (patch)
tree51cbb92f4e3e6ae31d678c26e4f49056f144af2e /lib/sasl/src/systools_lib.erl
parentf52452309cf68da898a1768eb6e8b6767e602bc7 (diff)
downloadotp-19d41eefa1cf4856587930d99959bbed73a818b5.tar.gz
otp-19d41eefa1cf4856587930d99959bbed73a818b5.tar.bz2
otp-19d41eefa1cf4856587930d99959bbed73a818b5.zip
Fix unmatched_return warnings in sasl
Diffstat (limited to 'lib/sasl/src/systools_lib.erl')
-rw-r--r--lib/sasl/src/systools_lib.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sasl/src/systools_lib.erl b/lib/sasl/src/systools_lib.erl
index 6618baa2aa..0a96f2bd48 100644
--- a/lib/sasl/src/systools_lib.erl
+++ b/lib/sasl/src/systools_lib.erl
@@ -34,8 +34,10 @@
file_term2binary(FileIn, FileOut) ->
case read_term(FileIn) of
{ok, Term} ->
- file:write_file(FileOut, term_to_binary(Term)),
- ok;
+ case file:write_file(FileOut, term_to_binary(Term)) of
+ ok -> ok;
+ {error,Error} -> {error,{open,FileOut,Error}}
+ end;
Other ->
Other
end.
@@ -51,8 +53,10 @@ read_term(File) ->
case file:open(File, [read]) of
{ok, Stream} ->
Res = read_term_from_stream(Stream, File),
- file:close(Stream),
- Res;
+ case file:close(Stream) of
+ ok -> Res;
+ {error,Error} -> {error,{close,File,Error}}
+ end;
{error, Error} ->
{error, {open,File,Error}}
end.