From: Daniel P. Berrange Date: Mon, 24 Oct 2011 16:34:18 +0000 (+0100) Subject: Report 'errno' in int1 field of virErrorPtr X-Git-Tag: CVE-2012-3445~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ef6f69a1bb0b0e15aa3a3a94915d35e3be410fb;p=thirdparty%2Flibvirt.git Report 'errno' in int1 field of virErrorPtr 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 --- diff --git a/src/util/virterror.c b/src/util/virterror.c index cb37be010e..b5c6853a60 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -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; }