aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-11-08 09:12:18 +0100
committerHans Bolinder <[email protected]>2010-11-08 09:12:18 +0100
commitcbdf6d5743f7f2a0f441dd023e9f3d95d4a5f279 (patch)
tree25dd2d511f28174e89006024a5babda9bcdce1b0 /lib/stdlib/src
parentf8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e (diff)
parent1d3edd9e902269d956d38e883127c9c7527f419d (diff)
downloadotp-cbdf6d5743f7f2a0f441dd023e9f3d95d4a5f279.tar.gz
otp-cbdf6d5743f7f2a0f441dd023e9f3d95d4a5f279.tar.bz2
otp-cbdf6d5743f7f2a0f441dd023e9f3d95d4a5f279.zip
Merge branch 'hb/stdlib/dets_init/OTP-8923' into dev
* hb/stdlib/dets_init/OTP-8923: Fix badly formed Dets file after initialization
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/dets_v8.erl2
-rw-r--r--lib/stdlib/src/dets_v9.erl5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/stdlib/src/dets_v8.erl b/lib/stdlib/src/dets_v8.erl
index 1f9f84cd27..af36958c1c 100644
--- a/lib/stdlib/src/dets_v8.erl
+++ b/lib/stdlib/src/dets_v8.erl
@@ -1074,6 +1074,8 @@ wl([], _Type, Del, Lookup, I, Objs) ->
[{Del, Lookup, Objs} | I].
%% -> {NewHead, ok} | {NewHead, Error}
+may_grow(Head, 0, once) ->
+ {Head, ok};
may_grow(Head, _N, _How) when Head#head.fixed =/= false ->
{Head, ok};
may_grow(#head{access = read}=Head, _N, _How) ->
diff --git a/lib/stdlib/src/dets_v9.erl b/lib/stdlib/src/dets_v9.erl
index 53238e962f..132af01f79 100644
--- a/lib/stdlib/src/dets_v9.erl
+++ b/lib/stdlib/src/dets_v9.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2010. 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
@@ -1908,6 +1908,9 @@ write_cache(Head) ->
end.
%% -> {NewHead, ok} | {NewHead, Error}
+may_grow(Head, 0, once) ->
+ %% Do not re-hash if there is a chance that the file is not dirty.
+ {Head, ok};
may_grow(Head, _N, _How) when Head#head.fixed =/= false ->
{Head, ok};
may_grow(#head{access = read}=Head, _N, _How) ->