Received: from eggs.gnu.org ([2001:4830:134:3::10]:35766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlvfN-0007HK-6u for qemu-devel@nongnu.org; Wed, 05 Nov 2014 03:10:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlvfF-0003ap-SE for qemu-devel@nongnu.org; Wed, 05 Nov 2014 03:10:09 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:23446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlvfF-0003Y0-Id for qemu-devel@nongnu.org; Wed, 05 Nov 2014 03:10:01 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEK00FND40NAL90@mailout3.samsung.com> for qemu-devel@nongnu.org; Wed, 05 Nov 2014 17:09:59 +0900 (KST) From: SeokYeon Hwang Date: Wed, 05 Nov 2014 17:09:52 +0900 Message-id: <1415174992-13246-1-git-send-email-syeon.hwang@samsung.com> Subject: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: SeokYeon Hwang , paolo.bonzini@gmail.com, armbru@redhat.com, mreitz@redhat.com Negative type of errno like -ERRNO is used a lot by developers. Therefore, error_set_errno() is modified to deal with a negative type of os_error. (Negative type is used at pcie_cap_slot_hotplug_common() in hw/pci/pcie.c) Signed-off-by: SeokYeon Hwang --- util/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/error.c b/util/error.c index 2ace0d8..5db00c9 100644 --- a/util/error.c +++ b/util/error.c @@ -68,7 +68,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class, va_start(ap, fmt); msg1 = g_strdup_vprintf(fmt, ap); if (os_errno != 0) { - err->msg = g_strdup_printf("%s: %s", msg1, strerror(os_errno)); + err->msg = g_strdup_printf("%s: %s", msg1, strerror(abs(os_errno))); g_free(msg1); } else { err->msg = msg1; -- 2.1.0