diff mbox

libibverbs: Force line-buffering in ibv_asyncwatch

Message ID ED0695A5-CBE3-4CE2-A20C-BBC7BEF28C33@Sun.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

HÃ¥kon Bugge Jan. 21, 2010, 1:40 p.m. UTC
None
diff mbox

Patch

diff --git a/examples/asyncwatch.c b/examples/asyncwatch.c
index e56b4dc..f9fe6ff 100644
--- a/examples/asyncwatch.c
+++ b/examples/asyncwatch.c
@@ -98,6 +98,9 @@  int main(int argc, char *argv[])
                return 1;
        }
 
+       /* Force line-buffering if stdout is redirected */
+       setlinebuf(stdout);
+
        printf("%s: async event FD %d\n",
               ibv_get_device_name(*dev_list), context->async_fd);