aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_local_db.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-01-31 13:51:01 +0100
committerMicael Karlberg <[email protected]>2012-01-31 13:51:01 +0100
commit92f9d6023275fbdf9a644c1061a5d1def49d13a3 (patch)
tree685a5c0e569dccb92a963c7087b7372acb1ed826 /lib/snmp/src/agent/snmpa_local_db.erl
parentb55c3d29a3d9efce2ce6548963809fc3b7ab8729 (diff)
parentb16baad540d35b890c0c6baf9a1be2a90ea96239 (diff)
downloadotp-92f9d6023275fbdf9a644c1061a5d1def49d13a3.tar.gz
otp-92f9d6023275fbdf9a644c1061a5d1def49d13a3.tar.bz2
otp-92f9d6023275fbdf9a644c1061a5d1def49d13a3.zip
Merge branch 'maint-r13' into bmk/snmp/snmp4217_integration/r14
Conflicts: lib/snmp/doc/src/notes.xml lib/snmp/doc/src/snmpa.xml lib/snmp/src/agent/snmpa_mpd.erl lib/snmp/src/app/snmp.appup.src lib/snmp/test/snmp_agent_test.erl lib/snmp/vsn.mk
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 df01091d53..ab277fc3e9 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),