]> xenbits.xensource.com Git - libvirt.git/commitdiff
virfile: Switch to virReportSystemError after failed VIR_CLOSE()
authorAdam Julis <ajulis@redhat.com>
Thu, 22 Feb 2024 09:14:35 +0000 (10:14 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 22 Feb 2024 09:23:20 +0000 (10:23 +0100)
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>
src/util/virfile.c

index 9463833d31c13a9526b0666c30c73d66fe9680d2..deaf4555fd8c56f819a46a1980ded24872c5edb3 100644 (file)
@@ -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;
     }