aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_agent.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-02-02 14:43:23 +0100
committerMicael Karlberg <[email protected]>2012-02-02 14:43:23 +0100
commit8929e4d94620c109d31387e6fadfa83b71121a6a (patch)
tree443a562e79c86c6b94c9bccb1432d9185d86bd27 /lib/snmp/src/agent/snmpa_agent.erl
parent135c76d6b80182d5c441ef0e07e2f271dcad8aed (diff)
parent92f9d6023275fbdf9a644c1061a5d1def49d13a3 (diff)
downloadotp-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_agent.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_agent.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl
index 17cb9c9fe3..9cc986cf47 100644
--- a/lib/snmp/src/agent/snmpa_agent.erl
+++ b/lib/snmp/src/agent/snmpa_agent.erl
@@ -1262,7 +1262,8 @@ handle_call(info, _From, S) ->
handle_call(get_net_if, _From, S) ->
{reply, get(net_if), S};
-handle_call({backup, BackupDir}, From, S) ->
+%% Only accept a backup request if there is none already in progress
+handle_call({backup, BackupDir}, From, #state{backup = undefined} = S) ->
?vlog("backup: ~p", [BackupDir]),
Pid = self(),
V = get(verbosity),
@@ -1279,7 +1280,11 @@ handle_call({backup, BackupDir}, From, S) ->
end),
?vtrace("backup server: ~p", [BackupServer]),
{noreply, S#state{backup = {BackupServer, From}}};
-
+
+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_mibs, _From, S) ->
Reply = snmpa_mib:dump(get(mibserver)),
{reply, Reply, S};