aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_local_db.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2012-02-02 15:45:07 +0100
committerErlang/OTP <[email protected]>2012-02-02 15:45:07 +0100
commit0c9547c384ba9d299d4a73bdf2a514c2b47128cd (patch)
tree58f49deaf3c65cdefeffe88a00443cf3b64753ca /lib/snmp/src/agent/snmpa_local_db.erl
parent61fa5c03369e9ae6de2b4ae24438c236df93d7cb (diff)
parent94da0412ba37e62567e3e377c1c6063c379c0fe1 (diff)
downloadotp-0c9547c384ba9d299d4a73bdf2a514c2b47128cd.tar.gz
otp-0c9547c384ba9d299d4a73bdf2a514c2b47128cd.tar.bz2
otp-0c9547c384ba9d299d4a73bdf2a514c2b47128cd.zip
Merge branch 'bmk/snmp4217_integration/r15' into maint-r15
* bmk/snmp4217_integration/r15: Prepare release [snmp/agent] Add proper release notes [snmp/agent] Wrong OID used for error message reply [snmp/agent] Added backup check for local_db [snmp/agent] Simultaneous snmpa:backup/1,2 calls interfere
Diffstat (limited to 'lib/snmp/src/agent/snmpa_local_db.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_local_db.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/snmp/src/agent/snmpa_local_db.erl b/lib/snmp/src/agent/snmpa_local_db.erl
index 5b04c70054..1ec8dd3874 100644
--- a/lib/snmp/src/agent/snmpa_local_db.erl
+++ b/lib/snmp/src/agent/snmpa_local_db.erl
@@ -486,7 +486,11 @@ handle_call({match, Name, Db, Pattern}, _From, State) ->
L1 = match(Db, Name, Pattern, State),
{reply, lists:delete([undef], L1), State};
-handle_call({backup, BackupDir}, From, #state{dets = Dets} = State) ->
+%% This check (that there is no backup already in progress) is also
+%% done in the master agent process, but just in case a user issues
+%% a backup call to this process directly, we add a similar check here.
+handle_call({backup, BackupDir}, From,
+ #state{backup = undefined, dets = Dets} = State) ->
?vlog("backup: ~p",[BackupDir]),
Pid = self(),
V = get(verbosity),
@@ -511,6 +515,10 @@ handle_call({backup, BackupDir}, From, #state{dets = Dets} = State) ->
{reply, Error, State}
end;
+handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
+ ?vinfo("backup already in progress: ~p", [Backup]),
+ {reply, {error, backup_in_progress}, S};
+
handle_call(dump, _From, #state{dets = Dets} = State) ->
?vlog("dump",[]),
dets_sync(Dets),