提交 b222c47b 编写于 作者: M Michal Privoznik 提交者: Cole Robinson

iohelper: Don't report errors on special FDs

Some FDs may not implement fdatasync() functionality,
e.g.  pipes. In that case EINVAL or EROFS is returned.
We don't want to fail then nor report any error.
Reported-by: NChristophe Fergeau <cfergeau@redhat.com>
(cherry picked from commit 46325e51)
上级 beb086f6
......@@ -181,9 +181,12 @@ runIO(const char *path, int fd, int oflags, unsigned long long length)
/* Ensure all data is written */
if (fdatasync(fdout) < 0) {
if (errno != EINVAL && errno != EROFS) {
/* fdatasync() may fail on some special FDs, e.g. pipes */
virReportSystemError(errno, _("unable to fsync %s"), fdoutname);
goto cleanup;
}
}
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册