]> xenbits.xensource.com Git - libvirt.git/commitdiff
Report 'errno' in int1 field of virErrorPtr
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 24 Oct 2011 16:34:18 +0000 (17:34 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 20 Jul 2012 19:36:06 +0000 (20:36 +0100)
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

index cb37be010e2a4221efb52b8ab43b7c5f85f63b40..b5c6853a607ac996d7a59fb5952d896e05cc0160 100644 (file)
@@ -1289,7 +1289,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;
 }