diff options
author | Micael Karlberg <[email protected]> | 2012-02-02 14:43:23 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-02-02 14:43:23 +0100 |
commit | 8929e4d94620c109d31387e6fadfa83b71121a6a (patch) | |
tree | 443a562e79c86c6b94c9bccb1432d9185d86bd27 /lib/snmp/src/agent/snmpa_local_db.erl | |
parent | 135c76d6b80182d5c441ef0e07e2f271dcad8aed (diff) | |
parent | 92f9d6023275fbdf9a644c1061a5d1def49d13a3 (diff) | |
download | otp-8929e4d94620c109d31387e6fadfa83b71121a6a.tar.gz otp-8929e4d94620c109d31387e6fadfa83b71121a6a.tar.bz2 otp-8929e4d94620c109d31387e6fadfa83b71121a6a.zip |
Merge branch 'bmk/snmp/snmp4217_integration/r14' into maint-r14
* bmk/snmp/snmp4217_integration/r14:
[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.erl | 10 |
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), |