Skip to content

Commit

Permalink
re #13527 cmd_status should clean up port
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed May 21, 2010
1 parent 1712899 commit 8700258
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mochiweb_util.erl
Expand Up @@ -123,7 +123,9 @@ cmd_string(Argv) ->
cmd_status(Argv) ->
Port = cmd_port(Argv, [exit_status, stderr_to_stdout,
use_stdio, binary]),
cmd_loop(Port, []).
try cmd_loop(Port, [])
after catch port_close(Port)
end.

%% @spec cmd_loop(port(), list()) -> {ExitStatus::integer(), Stdout::binary()}
%% @doc Accumulate the output and exit status from a port.
Expand Down

0 comments on commit 8700258

Please sign in to comment.