virfile: Switch to virReportSystemError after failed VIR_CLOSE()

VIR_CLOSE() sets errno on failure so it's better to use
virReportSystemError() than plain virReportError() as the former
reports errno value too.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Adam Julis 2024-02-22 10:14:35 +01:00 committed by Michal Privoznik
parent 04397de2a1
commit 969353f978

View File

@ -467,7 +467,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags)
goto error; goto error;
if (VIR_CLOSE(pipefd[!output]) < 0) { if (VIR_CLOSE(pipefd[!output]) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unable to close pipe")); virReportSystemError(errno, "%s", _("unable to close pipe"));
goto error; goto error;
} }