[libvirt] [PATCH] Report 'errno' in int1 field of virErrorPtr

From: "Daniel P. Berrange" <berrange@redhat.com> When reporting a system error (VIR_ERR_SYSTEM_ERROR) via virReportSystemError, we should copy the errno value into the 'int1' field of the virErrorPtr struct. This allows callers to detect certain errno conditions & discard the error * src/util/virterror.c: Place errno value in int1 field --- src/util/virterror.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/util/virterror.c b/src/util/virterror.c index 5006fa2..a9d4d38 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -1327,7 +1327,7 @@ void virReportSystemErrorFull(int domcode, virRaiseErrorFull(filename, funcname, linenr, domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, - msg, msgDetail, NULL, -1, -1, msg, msgDetail); + msg, msgDetail, NULL, theerrno, -1, msg, msgDetail); errno = save_errno; } -- 1.7.6.4

On 10/24/2011 10:35 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@redhat.com>
When reporting a system error (VIR_ERR_SYSTEM_ERROR) via virReportSystemError, we should copy the errno value into the 'int1' field of the virErrorPtr struct. This allows callers to detect certain errno conditions& discard the error
* src/util/virterror.c: Place errno value in int1 field --- src/util/virterror.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/virterror.c b/src/util/virterror.c index 5006fa2..a9d4d38 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -1327,7 +1327,7 @@ void virReportSystemErrorFull(int domcode,
virRaiseErrorFull(filename, funcname, linenr, domcode, VIR_ERR_SYSTEM_ERROR, VIR_ERR_ERROR, - msg, msgDetail, NULL, -1, -1, msg, msgDetail); + msg, msgDetail, NULL, theerrno, -1, msg, msgDetail);
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake