Skip to content

Commit

Permalink
Merge pull request #9232 from richcarl/ets-no-print
Browse files Browse the repository at this point in the history
Ets and Dets code should not be printing to stdout

OTP-19427
  • Loading branch information
IngelaAndin authored Jan 13, 2025
2 parents 72a7f0e + 3bad824 commit 7e07bb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/stdlib/src/dets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,7 @@ fopen2(Fname, Tab) ->
end,
case Do of
{repair, Mess} ->
io:format(user, "dets: file ~tp~s~n", [Fname, Mess]),
error_logger:format("dets: file ~tp~s~n", [Fname, Mess]),
case fsck(Fd, Tab, Fname, FH, default, default) of
ok ->
fopen2(Fname, Tab);
Expand Down Expand Up @@ -3269,7 +3269,7 @@ fopen_existing_file(Tab, OpenArgs) ->
_ when FH#fileheader.keypos =/= Kp ->
throw({error, {keypos_mismatch, Fname}});
{compact, SourceHead} ->
io:format(user, "dets: file ~tp is now compacted ...~n", [Fname]),
error_logger:format("dets: file ~tp is now compacted ...~n", [Fname]),
{ok, NewSourceHead} = open_final(SourceHead, Fname, read, false,
?DEFAULT_CACHE, Tab, Debug),
case catch compact(NewSourceHead) of
Expand All @@ -3279,14 +3279,14 @@ fopen_existing_file(Tab, OpenArgs) ->
_Err ->
_ = file:close(Fd),
dets_utils:stop_disk_map(),
io:format(user, "dets: compaction of file ~tp failed, "
"now repairing ...~n", [Fname]),
error_logger:format("dets: compaction of file ~tp failed, "
"now repairing ...~n", [Fname]),
{ok, Fd2, _FH} = read_file_header(Fname, Acc, Ram),
do_repair(Fd2, Tab, Fname, FH, MinSlots, MaxSlots,
OpenArgs)
end;
{repair, Mess} ->
io:format(user, "dets: file ~tp~s~n", [Fname, Mess]),
error_logger:format("dets: file ~tp~s~n", [Fname, Mess]),
do_repair(Fd, Tab, Fname, FH, MinSlots, MaxSlots,
OpenArgs);
{final, H} ->
Expand Down
4 changes: 1 addition & 3 deletions lib/stdlib/src/ets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2027,9 +2027,7 @@ fun2ms(ShellFun) when is_function(ShellFun) ->
{fun_data,ImportList,Clauses} ->
case ms_transform:transform_from_shell(
?MODULE,Clauses,ImportList) of
{error,[{_,[{_,_,Code}|_]}|_],_} ->
io:format("Error: ~ts~n",
[ms_transform:format_error(Code)]),
{error,[_|_],_} ->
{error,transform_error};
Else ->
Else
Expand Down

0 comments on commit 7e07bb8

Please sign in to comment.