[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] oslib: make error handling more reasonable
From: |
Zhi Yong Wu |
Subject: |
[Qemu-devel] [PATCH] oslib: make error handling more reasonable |
Date: |
Fri, 10 Feb 2012 22:34:13 +0800 |
From: Zhi Yong Wu <address@hidden>
Signed-off-by: Zhi Yong Wu <address@hidden>
---
oslib-posix.c | 4 ++--
oslib-win32.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/oslib-posix.c b/oslib-posix.c
index b6a3c7f..f978d56 100644
--- a/oslib-posix.c
+++ b/oslib-posix.c
@@ -80,7 +80,7 @@ void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno));
- abort();
+ exit(EXIT_FAILURE);
}
return ptr;
}
@@ -94,7 +94,7 @@ void *qemu_memalign(size_t alignment, size_t size)
if (ret != 0) {
fprintf(stderr, "Failed to allocate %zu B: %s\n",
size, strerror(ret));
- abort();
+ exit(EXIT_FAILURE);
}
#elif defined(CONFIG_BSD)
ptr = qemu_oom_check(valloc(size));
diff --git a/oslib-win32.c b/oslib-win32.c
index ce3021e..af2ff93 100644
--- a/oslib-win32.c
+++ b/oslib-win32.c
@@ -35,7 +35,7 @@ void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError());
- abort();
+ exit(EXIT_FAILURE);
}
return ptr;
}
@@ -45,7 +45,7 @@ void *qemu_memalign(size_t alignment, size_t size)
void *ptr;
if (!size) {
- abort();
+ exit(EXIT_FAILURE);
}
ptr = qemu_oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
trace_qemu_memalign(alignment, size, ptr);
--
1.7.6
- [Qemu-devel] [PATCH] oslib: make error handling more reasonable,
Zhi Yong Wu <=
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Daniel P. Berrange, 2012/02/10
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Zhi Yong Wu, 2012/02/10
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Stefan Weil, 2012/02/10
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Zhi Yong Wu, 2012/02/12
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Stefan Weil, 2012/02/13
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Stefan Hajnoczi, 2012/02/13
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Anthony Liguori, 2012/02/14
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Anthony Liguori, 2012/02/14
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Markus Armbruster, 2012/02/13
- Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable, Peter Maydell, 2012/02/13