提交 b8ef4758 编写于 作者: M Michal Privoznik

fdstreamtest: Print more info on read failure

It helps with debugging if we know what's the return value of
saferead().
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 1cb23be2
......@@ -250,14 +250,16 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
goto cleanup;
for (i = 0; i < 10; i++) {
size_t want;
size_t want, got;
if (i == 9)
want = PATTERN_LEN / 2;
else
want = PATTERN_LEN;
if (saferead(fd, buf, want) != want) {
virFilePrintf(stderr, "Short read from data\n");
if ((got = saferead(fd, buf, want)) != want) {
virFilePrintf(stderr,
"Short read from data, i=%zu got=%zu want=%zu\n",
i, got, want);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册