From: Gonglei <arei.gong...@huawei.com> Signed-off-by: Gonglei <arei.gong...@huawei.com> --- util/oslib-posix.c | 8 ++++---- util/oslib-win32.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 016a047..00310f6 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -88,7 +88,7 @@ int qemu_daemon(int nochdir, int noclose) void *qemu_oom_check(void *ptr) { if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); + error_report("Failed to allocate memory: %s", strerror(errno)); abort(); } return ptr; @@ -380,7 +380,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory) ret = sigaction(SIGBUS, &act, &oldact); if (ret) { - perror("os_mem_prealloc: failed to install signal handler"); + error_report("os_mem_prealloc: failed to install signal handler"); exit(1); } @@ -390,7 +390,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory) pthread_sigmask(SIG_UNBLOCK, &set, &oldset); if (sigsetjmp(sigjump, 1)) { - fprintf(stderr, "os_mem_prealloc: failed to preallocate pages\n"); + error_report("os_mem_prealloc: failed to preallocate pages"); exit(1); } else { int i; @@ -404,7 +404,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory) ret = sigaction(SIGBUS, &oldact, NULL); if (ret) { - perror("os_mem_prealloc: failed to reinstall signal handler"); + error_report("os_mem_prealloc: failed to reinstall signal handler"); exit(1); } diff --git a/util/oslib-win32.c b/util/oslib-win32.c index a3eab4a..47a0df7 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -44,7 +44,7 @@ void *qemu_oom_check(void *ptr) { if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()); + error_report("Failed to allocate memory: %lu", GetLastError()); abort(); } return ptr; -- 1.7.12.4