aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-05-17 10:14:29 +0200
committerSiri Hansen <[email protected]>2011-05-17 10:14:29 +0200
commit430056cfd0d8202337c87cb110818b8491caa41a (patch)
treee72f6dfff7cdeb8cc61fe1474427f7d367fff536 /lib/sasl
parentc666fa93b12399a0160b6bfedf002eacbc2f01e2 (diff)
parentb1dd3337729aa9340dba45c194c1896944262376 (diff)
downloadotp-430056cfd0d8202337c87cb110818b8491caa41a.tar.gz
otp-430056cfd0d8202337c87cb110818b8491caa41a.tar.bz2
otp-430056cfd0d8202337c87cb110818b8491caa41a.zip
Merge branch 'siri/sasl/rb-bugs/OTP-9149' into dev
* siri/sasl/rb-bugs/OTP-9149: Bugfix in rb:filter when using 're' (regexp) and 'no' Don't attempt to do supervisor:delete_child for temporary child Never fail when stopping rb, and fix file descriptor leak
Diffstat (limited to 'lib/sasl')
-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