aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-09-18 08:29:47 +0200
committerDan Gudmundsson <[email protected]>2015-09-18 08:29:47 +0200
commitb5fc65bb0a959bd96c125ce523c41052bbc0c04d (patch)
tree233429a59fd5a5e557861abe16fe23c01725d266 /lib/stdlib/src
parent3a33ee25ec2f9da0194a76649782154f41076cc9 (diff)
parentad7bb40d88acd0de5bdad9b64f8d8dd5c303fa48 (diff)
downloadotp-b5fc65bb0a959bd96c125ce523c41052bbc0c04d.tar.gz
otp-b5fc65bb0a959bd96c125ce523c41052bbc0c04d.tar.bz2
otp-b5fc65bb0a959bd96c125ce523c41052bbc0c04d.zip
Merge branch 'dgud/stdlib/fix-file-error_log-leak' into maint
* dgud/stdlib/fix-file-error_log-leak: stdlib: Fix leaking files after error_logger:logfile(close)
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/error_logger_file_h.erl10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/stdlib/src/error_logger_file_h.erl b/lib/stdlib/src/error_logger_file_h.erl
index 48c471924e..fea1656051 100644
--- a/lib/stdlib/src/error_logger_file_h.erl
+++ b/lib/stdlib/src/error_logger_file_h.erl
@@ -94,14 +94,8 @@ handle_call(filename, #st{filename=File}=State) ->
handle_call(_Query, State) ->
{ok, {error, bad_query}, State}.
-terminate(_Reason, State) ->
- case State of
- {Fd, _File, _Prev} ->
- ok = file:close(Fd);
- _ ->
- ok
- end,
- [].
+terminate(_Reason, #st{fd=Fd}) ->
+ file:close(Fd).
code_change(_OldVsn, State, _Extra) ->
{ok, State}.