diff options
author | Hans Bolinder <[email protected]> | 2013-04-22 15:28:49 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2013-05-06 12:14:12 +0200 |
commit | 21a7806986d58480367cff8d385a12f9659c7754 (patch) | |
tree | cba88bf517ff4f86b86bb0d649f5204bac4d9ade /lib/stdlib/src/log_mf_h.erl | |
parent | 0dc5a00011d1d24b68c9d43ff608415f84c50499 (diff) | |
download | otp-21a7806986d58480367cff8d385a12f9659c7754.tar.gz otp-21a7806986d58480367cff8d385a12f9659c7754.tar.bz2 otp-21a7806986d58480367cff8d385a12f9659c7754.zip |
Fix unmatched_returns warnings in STDLIB and Kernel
Diffstat (limited to 'lib/stdlib/src/log_mf_h.erl')
-rw-r--r-- | lib/stdlib/src/log_mf_h.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/stdlib/src/log_mf_h.erl b/lib/stdlib/src/log_mf_h.erl index 19b555a48c..6b42363979 100644 --- a/lib/stdlib/src/log_mf_h.erl +++ b/lib/stdlib/src/log_mf_h.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2012. All Rights Reserved. +%% Copyright Ericsson AB 1996-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -135,7 +135,12 @@ handle_event(Event, State) -> State#state{cur_fd = NewFd, curF = NewF, curB = 0} end, [Hi,Lo] = put_int16(Size), - file:write(NewState#state.cur_fd, [Hi, Lo, Bin]), + case file:write(NewState#state.cur_fd, [Hi, Lo, Bin]) of + ok -> + ok; + {error, Reason} -> + exit({file_exit, Reason}) + end, {ok, NewState#state{curB = NewState#state.curB + Size + 2}}; _ -> {ok, State} @@ -174,7 +179,7 @@ file_open(Dir, FileNo) -> write_index_file(Dir, FileNo), {ok, Fd}; _ -> - exit({file, open}) + exit(file_open) end. put_int16(I) -> @@ -211,7 +216,7 @@ write_index_file(Dir, Index) -> ok = file:close(Fd), ok = file:rename(TmpFile,File), ok; - _ -> exit(open_index_file) + _ -> exit(write_index_file) end. inc(N, Max) -> |