summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2019-09-03 11:05:44 +0200
committerMicael Karlberg <bmk@erlang.org>2019-09-03 11:08:34 +0200
commit8ebc60a857a52fe73e408d2588b2b43e1c3c3f18 (patch)
treee6540ccec43289ca84215da9234540c1090ca2cd
parentc09462a3132494ce139ad0df7ee37ae43104ca50 (diff)
downloaderlang-8ebc60a857a52fe73e408d2588b2b43e1c3c3f18.tar.gz
[snmp|agent] Fix dets bchunk return handling
The only thing from the ticket that was easily mapped on todays version of snmp (there has been a lot of changes to the app since this ticket was written 7 years ago) was this dets related issue (a clear bug). OTP-10400
-rw-r--r--lib/snmp/src/agent/snmpa_general_db.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/snmp/src/agent/snmpa_general_db.erl b/lib/snmp/src/agent/snmpa_general_db.erl
index 431302b6cc..0d4e39f56d 100644
--- a/lib/snmp/src/agent/snmpa_general_db.erl
+++ b/lib/snmp/src/agent/snmpa_general_db.erl
@@ -534,16 +534,16 @@ dets_backup(close, _Cont, _Name, B) ->
ok;
dets_backup(read, Cont1, Name, B) ->
case dets:bchunk(Name, Cont1) of
+ {error, _} = ERROR ->
+ ERROR;
+ '$end_of_table' ->
+ dets:close(B),
+ end_of_input;
{Cont2, Data} ->
F = fun(Arg) ->
dets_backup(Arg, Cont2, Name, B)
end,
- {Data, F};
- '$end_of_table' ->
- dets:close(B),
- end_of_input;
- Error ->
- Error
+ {Data, F}
end.