aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/standard_error.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-04-29 15:25:27 +0000
committerErlang/OTP <[email protected]>2010-04-29 15:25:27 +0000
commitb328564bfe321c2df597c77fea57566ee8d00f2b (patch)
tree48d06057fad0819ebdf2811992631e6ae8ebb2c9 /lib/kernel/src/standard_error.erl
parentc8fbe3f82050477a713b22b5d3b671718588aa79 (diff)
parent75ea6a39d1cf4bd4a67391595b90d8d90155d012 (diff)
downloadotp-b328564bfe321c2df597c77fea57566ee8d00f2b.tar.gz
otp-b328564bfe321c2df597c77fea57566ee8d00f2b.tar.bz2
otp-b328564bfe321c2df597c77fea57566ee8d00f2b.zip
Merge branch 'ks/kernel' into dev
* ks/kernel: kernel: Clean up as suggested by tidier OTP-8606 ks/kernel
Diffstat (limited to 'lib/kernel/src/standard_error.erl')
-rw-r--r--lib/kernel/src/standard_error.erl24
1 files changed, 4 insertions, 20 deletions
diff --git a/lib/kernel/src/standard_error.erl b/lib/kernel/src/standard_error.erl
index 98a44d1ee9..e41dcd01fc 100644
--- a/lib/kernel/src/standard_error.erl
+++ b/lib/kernel/src/standard_error.erl
@@ -24,8 +24,6 @@
-define(NAME, standard_error).
-define(PROCNAME_SUP, standard_error_sup).
-%% Internal exports
--export([server/1, server/2]).
%% Defines for control ops
-define(CTRL_OP_GET_WINSIZE,100).
@@ -54,18 +52,11 @@ init([]) ->
{error,no_stderror}
end.
-
start_port(PortSettings) ->
- Id = spawn(?MODULE,server,[{fd,2,2},PortSettings]),
- register(?NAME,Id),
+ Id = spawn(fun () -> server({fd,2,2}, PortSettings) end),
+ register(?NAME, Id),
Id.
-
-server(Pid) when is_pid(Pid) ->
- process_flag(trap_exit, true),
- link(Pid),
- run(Pid).
-
server(PortName,PortSettings) ->
process_flag(trap_exit, true),
Port = open_port(PortName,PortSettings),
@@ -88,17 +79,15 @@ server_loop(Port) ->
server_loop(Port)
end.
-
get_fd_geometry(Port) ->
case (catch port_control(Port,?CTRL_OP_GET_WINSIZE,[])) of
- List when is_list(List), length(List) =:= 8 ->
+ List when length(List) =:= 8 ->
<<W:32/native,H:32/native>> = list_to_binary(List),
{W,H};
_ ->
error
end.
-
%% NewSaveBuffer = io_request(Request, FromPid, ReplyAs, Port, SaveBuffer)
do_io_request(Req, From, ReplyAs, Port) ->
@@ -227,12 +216,7 @@ do_setopts(Opts, _Port) ->
{ok,ok}.
getopts(_Port) ->
- Uni = {unicode, case get(unicode) of
- true ->
- true;
- _ ->
- false
- end},
+ Uni = {unicode, get(unicode) =:= true},
{ok,[Uni]}.
wrap_characters_to_binary(Chars,From,To) ->