From: Adam Julis Date: Thu, 22 Feb 2024 09:14:35 +0000 (+0100) Subject: virfile: Switch to virReportSystemError after failed VIR_CLOSE() X-Git-Tag: v10.1.0-rc1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=969353f97847394fca1dcd5f2d7af17fae7a1cbc;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Michal Privoznik --- diff --git a/src/util/virfile.c b/src/util/virfile.c index 9463833d31..deaf4555fd 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -467,7 +467,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) goto error; 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; }