public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libibverbs: Force line-buffering in ibv_asyncwatch
@ 2010-01-21 13:40 Håkon Bugge
       [not found] ` <ED0695A5-CBE3-4CE2-A20C-BBC7BEF28C33-U0mLk4xYmo8@public.gmane.org>
       [not found] ` <4B5BD8B5.2080102@voltaire.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Håkon Bugge @ 2010-01-21 13:40 UTC (permalink / raw)
  To: Vladimir Sokolovsky; +Cc: OFED mailing list, Or Gerlitz

ibv_asyncwatch defaults to block-buffering when stdout is redirected to a file or pipe. This fix makes it more usable in scripted environments.

Signed-off-by: Hakon Bugge <Haakon.Bugge-xsfywfwIY+M@public.gmane.org>
---
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);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-03 10:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-21 13:40 [PATCH] libibverbs: Force line-buffering in ibv_asyncwatch Håkon Bugge
     [not found] ` <ED0695A5-CBE3-4CE2-A20C-BBC7BEF28C33-U0mLk4xYmo8@public.gmane.org>
2010-01-21 14:18   ` Bart Van Assche
     [not found]     ` <e2e108261001210618p476ed03bofa2e46c223578e1a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-21 15:01       ` Håkon Bugge
     [not found]         ` <C25CCF03-2542-4C8D-9AF4-122DBF56F856-UdXhSnd/wVw@public.gmane.org>
2010-06-02 17:05           ` Roland Dreier
     [not found]             ` <ada7hmhtle3.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2010-06-03 10:54               ` Håkon Bugge
     [not found] ` <4B5BD8B5.2080102@voltaire.com>
     [not found]   ` <23AC7B6E-377F-4CFC-AD9D-0D2FD27662C7@Sun.COM>
     [not found]     ` <23AC7B6E-377F-4CFC-AD9D-0D2FD27662C7-UdXhSnd/wVw@public.gmane.org>
2010-01-25  9:44       ` Or Gerlitz
     [not found]         ` <4B5D67FE.80509-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-01-25  9:47           ` Vladimir Sokolovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox