From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvsBT-0004Vj-Tk for qemu-devel@nongnu.org; Fri, 10 Feb 2012 10:14:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvsBK-0006yC-Gg for qemu-devel@nongnu.org; Fri, 10 Feb 2012 10:14:47 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:42644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvsBK-0006y6-Cp for qemu-devel@nongnu.org; Fri, 10 Feb 2012 10:14:38 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Feb 2012 10:14:36 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 9F6CC6E8066 for ; Fri, 10 Feb 2012 10:13:51 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1AFDpkR136468 for ; Fri, 10 Feb 2012 10:13:51 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1AFDovf031337 for ; Fri, 10 Feb 2012 10:13:51 -0500 From: Zhi Yong Wu Date: Fri, 10 Feb 2012 23:13:41 +0800 Message-Id: <1328886821-2127-1-git-send-email-zwu.kernel@gmail.com> Subject: [Qemu-devel] [PATCH v2] oslib: make error handling more reasonable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Zhi Yong Wu , stefanha@linux.vnet.ibm.com From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- oslib-posix.c | 4 ++-- oslib-win32.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oslib-posix.c b/oslib-posix.c index b6a3c7f..3b7cd9d 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..67b82d3 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; } -- 1.7.6