qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error.
@ 2014-11-05  8:09 SeokYeon Hwang
  2014-11-05  8:12 ` Max Reitz
  0 siblings, 1 reply; 12+ messages in thread
From: SeokYeon Hwang @ 2014-11-05  8:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: SeokYeon Hwang, paolo.bonzini, armbru, mreitz

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 <syeon.hwang@samsung.com>
---
 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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-07  2:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05  8:09 [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error SeokYeon Hwang
2014-11-05  8:12 ` Max Reitz
2014-11-05 10:57   ` Paolo Bonzini
2014-11-05 11:11     ` Max Reitz
2014-11-05 11:19       ` Eric Blake
2014-11-06  4:49         ` Amos Kong
2014-11-05 12:44       ` Paolo Bonzini
2014-11-05 13:13         ` SeokYeon Hwang
2014-11-05 13:29         ` Markus Armbruster
2014-11-06  2:02         ` SeokYeon Hwang
2014-11-06  9:25           ` Markus Armbruster
2014-11-07  2:26             ` SeokYeon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).