[haiku-bugs] [Haiku] #13544: Possible bug in setvbuf handling

  • From: "miqlas" <trac@xxxxxxxxxxxx>
  • Date: Mon, 05 Jun 2017 06:55:19 -0000

#13544: Possible bug in setvbuf handling
-----------------------------------+------------------------------
 Reporter:  miqlas                 |        Owner:  jackburton
     Type:  bug                    |       Status:  new
 Priority:  normal                 |    Milestone:  Unscheduled
Component:  Applications/Terminal  |      Version:  R1/Development
 Keywords:                         |   Blocked By:
 Blocking:                         |  Has a Patch:  0
 Platform:  All                    |
-----------------------------------+------------------------------
 The latest fish-shell doesn't print newline character after the commands.
 The fish developers concluded it could be abug in the setvbuf handling in
 Haiku:


 {{{
 I've determined the problem is due to a bug in the setvbuf() function on
 Haiku. Fish calls it to set stdout to fully unbuffered. That causes any
 subsequent writes using that file handle to discard the output. It only
 seems to affect wide char output. If you compile and run the following
 program you'll see that "goodbye" isn't seen:


 {{{
 #include <stdio.h>
 #include <wchar.h>
 int main() {
     fwprintf(stdout, L"hello\n");
     setvbuf(stdout, NULL, _IONBF, 0);
     fwprintf(stdout, L"goodbye\n");
 }
 }}}


 If you switch to fprintf() it works.

 I think I'm still going to replace the fputwc() calls with simple write()
 calls since that should be okay but you should file a bug with the Haiku
 project about this.
 }}}

 Original issue at fish-shell page: [https://github.com/fish-shell/fish-
 shell/issues/4100]

--
Ticket URL: <https://dev.haiku-os.org/ticket/13544>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: