mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
util: Move error reporting back to virFileWrapperFdClose()
virFileWrapperFdFree(), like all free functions, is supposed to only release allocated resources, so error reporting is better suited for virFileWrapperFdClose(). This reverts commit b0c3e931804a86cd7146db0164ab4843039c410b. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e0e16a3d9a
commit
4640131ba3
@ -337,6 +337,9 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
|
||||
|
||||
ret = virCommandWait(wfd->cmd, NULL);
|
||||
|
||||
if (wfd->err_msg && *wfd->err_msg)
|
||||
VIR_WARN("iohelper reports: %s", wfd->err_msg);
|
||||
|
||||
wfd->closed = true;
|
||||
|
||||
return ret;
|
||||
@ -357,11 +360,6 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
|
||||
if (!wfd)
|
||||
return;
|
||||
|
||||
if (wfd->err_msg && *wfd->err_msg)
|
||||
VIR_WARN("iohelper reports: %s", wfd->err_msg);
|
||||
|
||||
virCommandAbort(wfd->cmd);
|
||||
|
||||
VIR_FREE(wfd->err_msg);
|
||||
virCommandFree(wfd->cmd);
|
||||
VIR_FREE(wfd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user