1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

poll: add stdout fflush after poll query

ATM it's a bit ugly to enforce flushing of 'stdio' here, but works as quick
hot-fix.

log_print*() is using buffered I/O.

But for pooling with typical 1s interval this may take a while before
buffer about continues progress gets flushed.
So ATM fflush().

TODO: either add  log_print*_with_flush() or maybe directly use just
line buffering with log_print() and only log_debug() keep using buffered
I/O mode.
This commit is contained in:
Zdenek Kabelac 2018-05-07 11:46:09 +02:00
parent 09fcc8eaa8
commit 6740c78e83

View File

@ -80,6 +80,8 @@ static int _check_lv_status(struct cmd_context *cmd,
}
progress = parms->poll_fns->poll_progress(cmd, lv, name, parms);
fflush(stdout);
if (progress == PROGRESS_CHECK_FAILED)
return_0;
@ -448,6 +450,7 @@ static int _report_progress(struct cmd_context *cmd, struct poll_operation_id *i
ret = 0;
goto out;
}
fflush(stdout);
ret = 1;