[PATCH] virfile: switch to virReportSystemError in VIR_CLOSE() cond.

Adam Julis posted 1 patch 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/5d90c757dbffe8a78a87fb833e484910d400b2c0.1708593249.git.ajulis@redhat.com
src/util/virfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] virfile: switch to virReportSystemError in VIR_CLOSE() cond.
Posted by Adam Julis 2 months ago
VIR_CLOSE also set errno, so it's not nessesary use virReportError with explicit error code

Signed-off-by: Adam Julis <ajulis@redhat.com>
---
 src/util/virfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
     }
 
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH] virfile: switch to virReportSystemError in VIR_CLOSE() cond.
Posted by Michal Prívozník 2 months ago
On 2/22/24 10:14, Adam Julis wrote:
> VIR_CLOSE also set errno, so it's not nessesary use virReportError with explicit error code
> 
> Signed-off-by: Adam Julis <ajulis@redhat.com>
> ---
>  src/util/virfile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I've tweaked the commit message a bit and merged.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org