aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/rb.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sasl/src/rb.erl')
-rw-r--r--lib/sasl/src/rb.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sasl/src/rb.erl b/lib/sasl/src/rb.erl
index 13753565d8..8004ef2c5a 100644
--- a/lib/sasl/src/rb.erl
+++ b/lib/sasl/src/rb.erl
@@ -53,8 +53,7 @@ start_link(Options) ->
gen_server:start_link({local, rb_server}, rb, Options, []).
stop() ->
- call(stop),
- supervisor:delete_child(sasl_sup, rb_server).
+ supervisor:terminate_child(sasl_sup, rb_server).
rescan() -> rescan([]).
rescan(Options) ->
@@ -205,8 +204,6 @@ handle_call({rescan, Options}, _From, State) ->
NewState = State#state{data = Data, max = Max, type = Type,
device = Device, abort = Abort, log = Log1},
{reply, ok, NewState};
-handle_call(stop, _From, State) ->
- {stop, normal, stopped, State};
handle_call(_, _From, #state{data = undefined}) ->
{reply, {error, no_data}, #state{}};
handle_call({list, Type}, _From, State) ->
@@ -312,11 +309,14 @@ scan_files(RptDir, Max, Type) ->
{ok, Fd} ->
case catch file:read(Fd, 1) of
{ok, [LastWritten]} ->
+ file:close(Fd),
Files = make_file_list(RptDir, LastWritten),
scan_files(RptDir, Files, Max, Type);
- _ -> exit("cannot read the index file")
+ _X ->
+ file:close(Fd),
+ exit("cannot read the index file")
end;
- _ -> exit("cannot read the index file")
+ _X -> exit("cannot read the index file")
end.
make_file_list(Dir, FirstFileNo) ->
@@ -789,7 +789,7 @@ filter_report([{Key, RegExp, re}|T], Msg) ->
filter_report([{Key, RegExp, re, no}|T], Msg) ->
case proplists:get_value(Key, Msg) of
undefined ->
- false;
+ true;
Value ->
Subject = lists:flatten(io_lib:format("~p",[Value])),
case run_re(Subject, RegExp) of