mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-05 19:29:33 +00:00
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: Christophe Fergeau <cfergeau@redhat.com> (cherry picked from commit 46325e51310344872597453ba5d621afa88d44c1)
This commit is contained in:
parent
beb086f638
commit
b222c47b53
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user