oslib: make error handling more reasonable
PATCH v2 1/1 oslib: make error handling more reasonable
From: Zhi Yong Wu <[email protected]>
Signed-off-by Zhi Yong Wu <[email protected]>
--- oslib-posix.c | 4 ++-- oslib-win32.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
oslib-posix.c +2 -2
@@ -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));
oslib-win32.c +1 -1
@@ -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; }
Signature · 1 line
1.7.6