diff options
author | Hans Bolinder <[email protected]> | 2012-03-21 08:18:58 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2012-03-21 08:18:58 +0100 |
commit | 5dc35dc142de8875bf81fb2bbf6f6bfc8c731438 (patch) | |
tree | 1d53f3be75bf396502d79b5ecc41e55e16479754 /lib | |
parent | 3afb68a0fccdc7372b6a8f237d3efc88697f21e6 (diff) | |
parent | 2fc45e219d8957803ea77f4bac62f238424dbda4 (diff) | |
download | otp-5dc35dc142de8875bf81fb2bbf6f6bfc8c731438.tar.gz otp-5dc35dc142de8875bf81fb2bbf6f6bfc8c731438.tar.bz2 otp-5dc35dc142de8875bf81fb2bbf6f6bfc8c731438.zip |
Merge branch 'maint'
* maint:
Make sure disk_log does not write too much data
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/src/disk_log.erl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl index fb9415d440..f5f972c112 100644 --- a/lib/kernel/src/disk_log.erl +++ b/lib/kernel/src/disk_log.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2012. 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 @@ -1034,10 +1034,9 @@ sync_loop(From, S) -> -define(MAX_LOOK_AHEAD, 64*1024). %% Inlined. -log_loop(S, Pids, _Bins, _Sync, _Sz) when S#state.cache_error =/= ok -> +log_loop(#state{cache_error = CE}=S, Pids, _Bins, _Sync, _Sz) when CE =/= ok -> loop(cache_error(S, Pids)); -log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz) - when Sz > ?MAX_LOOK_AHEAD -> +log_loop(#state{}=S, Pids, Bins, Sync, Sz) when Sz > ?MAX_LOOK_AHEAD -> loop(log_end(S, Pids, Bins, Sync)); log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz) -> receive @@ -1046,8 +1045,7 @@ log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz) -> after 0 -> loop(log_end(S, Pids, Bins, Sync)) end; -log_loop(S, Pids, Bins, Sync, Sz) -> - [M | Ms] = S#state.messages, +log_loop(#state{messages = [M | Ms]}=S, Pids, Bins, Sync, Sz) -> S1 = S#state{messages = Ms}, log_loop(M, Pids, Bins, Sync, Sz, S1, get(log)). |