ibv_asyncwatch defaults to block-buffering when stdout is redirected to
a file or pipe. Changing to line-buffered mode makes it more usable in
scripted environments.
Signed-off-by: Hakon Bugge <Haakon.Bugge@sun.com>
struct ibv_context *context;
struct ibv_async_event event;
+ /* Force line-buffering in case stdout is redirected */
+ setvbuf(stdout, NULL, _IOLBF, 0);
+
dev_list = ibv_get_device_list(NULL);
if (!dev_list) {
perror("Failed to get IB devices list");