Skip to content

Commit 2b2034c

Browse files
committed
os_mon: Fix failing port_close
Use asynchtonous close message to not fail on already closed port.
1 parent 5400ccf commit 2b2034c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/os_mon/src/cpu_sup.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ port_server_loop(Port, Timeout) ->
613613

614614
% Close port and this server
615615
{Pid, ?quit} ->
616-
port_command(Port, ?quit),
617-
port_close(Port),
616+
Port ! {self(), {command, ?quit}},
617+
Port ! {self(), close},
618618
Pid ! {self(), {data, quit}},
619619
ok;
620620

lib/os_mon/src/memsup.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ start_portprogram() ->
653653

654654
port_shutdown(Port) ->
655655
Port ! {self(), {command, [?EXIT]}},
656-
port_close(Port).
656+
Port ! {self(), close}.
657657

658658
%% The connected process loops are a bit awkward (several different
659659
%% functions doing almost the same thing) as

0 commit comments

Comments
 (0)