<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi!<br>
      <br>
      On 07/30/2013 12:39 AM, José Valim wrote:<br>
    </div>
    <blockquote
cite="mid:CAGnRm4KqJ7q+nFOD7qEmW98F15L_NsJfN9Fqt30S1PpHr3wZ3A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <a moz-do-not-send="true"
        href="http://erlang.org/doc/man/erlang.html#halt-2">According to
        the documentation</a>, erlang:halt/2 should flush unless
      {flush,false} is given:
      <div><br>
      </div>
      <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:medium;background-color:rgb(255,255,255)">For
          integer </span><span class="code"
style="font-family:Courier,monospace;font-size:medium;background-color:rgb(255,255,255)">Status</span><span
style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:medium;background-color:rgb(255,255,255)"> the
          Erlang runtime system closes all ports and allows async
          threads to finish their operations before exiting. To exit
          without such flushing use </span><span class="code"
style="font-family:Courier,monospace;font-size:medium;background-color:rgb(255,255,255)">Option</span><span
style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:medium;background-color:rgb(255,255,255)"> as </span><span
          class="code"
style="font-family:Courier,monospace;font-size:medium;background-color:rgb(255,255,255)">{flush,false}</span><span
style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:medium;background-color:rgb(255,255,255)">.</span></blockquote>
      <div><br>
      </div>
      <div>
        <div>However, we noticed that erlang:halt(0, []) is not flushing
          at all. Looking at the code, we were able to verify it:</div>
        <div><br>
        </div>
        <div><a moz-do-not-send="true"
href="https://github.com/erlang/otp/blob/a5fc79292b9b018cd39d104a8cd2e79de141e3ad/erts/emulator/beam/bif.c#L3937">https://github.com/erlang/otp/blob/a5fc79292b9b018cd39d104a8cd2e79de141e3ad/erts/emulator/beam/bif.c#L3937</a></div>
        <div><br>
        </div>
        <div>The value of flush should be initialized to 1.</div>
        <div><br>
        </div>
        <div>Thank you!</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    Yes, that is a bug and your suggested fix seems the right thing to
    do. I'll fix it.<br>
    <blockquote
cite="mid:CAGnRm4KqJ7q+nFOD7qEmW98F15L_NsJfN9Fqt30S1PpHr3wZ3A@mail.gmail.com"
      type="cite">
      <div>
        <div>PS: erlang:halt/0 and erlang:halt/1 **are** working as
          advertised.</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    Thanks!<br>
    Patrik<br>
    <blockquote
cite="mid:CAGnRm4KqJ7q+nFOD7qEmW98F15L_NsJfN9Fqt30S1PpHr3wZ3A@mail.gmail.com"
      type="cite">
      <div>
        <div>
          <div>
            <div><br>
            </div>
            <div><span style="font-size:13px">
                <div><span
style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José
                      Valim</b></span></div>
                <div><span
style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">
                    <div>
                      <span
                        style="font-family:verdana,sans-serif;font-size:x-small"><a
                          moz-do-not-send="true"
                          href="http://www.plataformatec.com.br/"
                          style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div>
                    <div><span
                        style="font-family:verdana,sans-serif;font-size:x-small">Skype:
                        jv.ptec</span></div>
                    <div><span
                        style="font-family:verdana,sans-serif;font-size:x-small">Founder
                        and Lead Developer</span></div>
                  </span></div>
              </span></div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>