Skip to content

Commit d63d2c9

Browse files
author
José Valim
committed
Get rid of buggy System.halt/2
Closes #1515, thanks to @AtKaaZ for debugging and pinpointing this function as the root cause for output issues on Windows.
1 parent abb2ada commit d63d2c9

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* [Mix] `:test_coverage` option now expect keywords arguments and the `--cover` flag is now treated as a boolean
4141

4242
* backwards incompatible changes
43+
* [System] `System.halt/2` was removed since the current Erlang implementation of such function is bugged
4344

4445
# v0.10.0 (2013-07-15)
4546

lib/elixir/lib/system.ex

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -324,30 +324,25 @@ defmodule System do
324324
Note that on many platforms, only the status codes 0-255 are supported
325325
by the operating system.
326326
327-
For integer status, Erlang runtime system closes all ports and allows async
328-
threads to finish their operations before exiting. To exit without such
329-
flushing, pass options `[flush: false]` instead.
330-
331-
For more information, check: http://www.erlang.org/doc/man/erlang.html#halt-2
327+
For more information, check: http://www.erlang.org/doc/man/erlang.html#halt-1
332328
333329
## Examples
334330
335331
System.halt(0)
336-
System.halt(1, flush: false)
332+
System.halt(1)
337333
System.halt(:abort)
338334
339335
"""
340336
@spec halt() :: no_return
341337
@spec halt(non_neg_integer | binary | :abort) :: no_return
342-
@spec halt(non_neg_integer | binary | :abort, [] | [flush: false]) :: no_return
343-
def halt(status // 0, options // [])
338+
def halt(status // 0)
344339

345-
def halt(status, options) when is_integer(status) or status == :abort do
346-
:erlang.halt(status, options)
340+
def halt(status) when is_integer(status) or status == :abort do
341+
:erlang.halt(status)
347342
end
348343

349-
def halt(status, options) when is_binary(status) do
350-
:erlang.halt(binary_to_list(status), options)
344+
def halt(status) when is_binary(status) do
345+
:erlang.halt(binary_to_list(status))
351346
end
352347

353348
## Helpers

0 commit comments

Comments
 (0)