From 19d41eefa1cf4856587930d99959bbed73a818b5 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 26 Apr 2013 14:21:12 +0200 Subject: Fix unmatched_return warnings in sasl --- lib/sasl/src/systools_lib.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/sasl/src/systools_lib.erl') 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. -- cgit v1.2.3