aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_mib.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_mib.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_mib.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_mib.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/snmp/src/agent/snmpa_mib.erl b/lib/snmp/src/agent/snmpa_mib.erl
index ce90db18b3..574467d38f 100644
--- a/lib/snmp/src/agent/snmpa_mib.erl
+++ b/lib/snmp/src/agent/snmpa_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -552,8 +552,12 @@ handle_call({dump, File}, _From, #state{data = Data} = State) ->
Reply = snmpa_mib_data:dump(Data, File),
{reply, Reply, State};
-handle_call({backup, BackupDir}, From, #state{data = Data} = State) ->
- ?vlog("backup to ~s",[BackupDir]),
+%% 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, data = Data} = State) ->
+ ?vlog("backup to ~s", [BackupDir]),
Pid = self(),
V = get(verbosity),
case file:read_file_info(BackupDir) of
@@ -576,6 +580,10 @@ handle_call({backup, BackupDir}, From, #state{data = Data} = 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(stop, _From, State) ->
?vlog("stop",[]),
{stop, normal, ok, State};