diff options
author | Kostis Sagonas <[email protected]> | 2010-03-07 11:05:06 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-04-28 07:04:56 +0200 |
commit | 75ea6a39d1cf4bd4a67391595b90d8d90155d012 (patch) | |
tree | 7641cd91bbe2a28399280d691fe3904e0cf26913 /lib/kernel/src/standard_error.erl | |
parent | 39e5ca57147c08502806f873c107c77e197a78ab (diff) | |
download | otp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.tar.gz otp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.tar.bz2 otp-75ea6a39d1cf4bd4a67391595b90d8d90155d012.zip |
kernel: Clean up as suggested by tidier
Diffstat (limited to 'lib/kernel/src/standard_error.erl')
-rw-r--r-- | lib/kernel/src/standard_error.erl | 24 |
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) -> |