[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negat
From: |
SeokYeon Hwang |
Subject: |
[Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error. |
Date: |
Wed, 05 Nov 2014 17:09:52 +0900 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error.,
SeokYeon Hwang <=
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., Max Reitz, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., Paolo Bonzini, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., Paolo Bonzini, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., SeokYeon Hwang, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., Markus Armbruster, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., SeokYeon Hwang, 2014/11/05
- Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error., Markus Armbruster, 2014/11/06