[erlang-bugs] erlang:halt/2 doesn't flush by default as advertised

Patrik Nyblom pan@REDACTED
Tue Jul 30 10:20:43 CEST 2013


Hi!

On 07/30/2013 12:39 AM, José Valim wrote:
> According to the documentation 
> <http://erlang.org/doc/man/erlang.html#halt-2>, erlang:halt/2 should 
> flush unless {flush,false} is given:
>
>     For integer Status the Erlang runtime system closes all ports and
>     allows async threads to finish their operations before exiting. To
>     exit without such flushing use Option as {flush,false}.
>
>
> However, we noticed that erlang:halt(0, []) is not flushing at all. 
> Looking at the code, we were able to verify it:
>
> https://github.com/erlang/otp/blob/a5fc79292b9b018cd39d104a8cd2e79de141e3ad/erts/emulator/beam/bif.c#L3937
>
> The value of flush should be initialized to 1.
>
> Thank you!
>
Yes, that is a bug and your suggested fix seems the right thing to do. 
I'll fix it.
> PS: erlang:halt/0 and erlang:halt/1 **are** working as advertised.
>
Thanks!
Patrik
>
> *José Valim*
> www.plataformatec.com.br <http://www.plataformatec.com.br/>
> Skype: jv.ptec
> Founder and Lead Developer
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130730/4355244c/attachment.htm>


More information about the erlang-bugs mailing list