Patchwork Abort on thread layer errors

login
register
mail settings
Submitter Jan Kiszka
Date Sept. 21, 2011, 7:28 a.m.
Message ID <4E79921F.5080605@siemens.com>
Download mbox | patch
Permalink /patch/115697/
State New
Headers show

Comments

Jan Kiszka - Sept. 21, 2011, 7:28 a.m.
Makes it easier to catch the bug in gdb as there is no need to set an
explicit breakpoint.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 qemu-thread-posix.c |    2 +-
 qemu-thread-win32.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Stefan Hajnoczi - Sept. 21, 2011, 10:20 a.m.
On Wed, Sep 21, 2011 at 09:28:31AM +0200, Jan Kiszka wrote:
> Makes it easier to catch the bug in gdb as there is no need to set an
> explicit breakpoint.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  qemu-thread-posix.c |    2 +-
>  qemu-thread-win32.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

Patch

diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c
index 2bd02ef..ac3c0c9 100644
--- a/qemu-thread-posix.c
+++ b/qemu-thread-posix.c
@@ -22,7 +22,7 @@ 
 static void error_exit(int err, const char *msg)
 {
     fprintf(stderr, "qemu: %s: %s\n", msg, strerror(err));
-    exit(1);
+    abort();
 }
 
 void qemu_mutex_init(QemuMutex *mutex)
diff --git a/qemu-thread-win32.c b/qemu-thread-win32.c
index a27332e..db8e744 100644
--- a/qemu-thread-win32.c
+++ b/qemu-thread-win32.c
@@ -24,7 +24,7 @@  static void error_exit(int err, const char *msg)
                   NULL, err, 0, (LPTSTR)&pstr, 2, NULL);
     fprintf(stderr, "qemu: %s: %s\n", msg, pstr);
     LocalFree(pstr);
-    exit(1);
+    abort();
 }
 
 void qemu_mutex_init(QemuMutex *mutex)