From de7e7585dd0cbf979061420f6997cb83d5b1195e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 22 Jun 2014 10:31:11 +0200 Subject: [PATCH] core: do not exit WeeChat in weechat_end() (let the caller do that) This is needed for automated tests, to exit with return code of tests. --- src/core/weechat.c | 4 ++-- src/gui/curses/main.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/weechat.c b/src/core/weechat.c index 65a65c64a..50dca27f2 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -486,7 +486,7 @@ weechat_shutdown (int return_code, int crash) if (crash) abort(); - else + else if (return_code >= 0) exit (return_code); } @@ -590,5 +590,5 @@ weechat_end (void (*gui_end_cb)(int clean_exit)) hdata_end (); /* end hdata */ secure_end (); /* end secured data */ string_end (); /* end string */ - weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */ + weechat_shutdown (-1, 0); /* end other things */ } diff --git a/src/gui/curses/main.c b/src/gui/curses/main.c index a234610f2..4176b9085 100644 --- a/src/gui/curses/main.c +++ b/src/gui/curses/main.c @@ -41,6 +41,5 @@ main (int argc, char *argv[]) gui_main_loop (); weechat_end (&gui_main_end); - /* make C compiler happy (never executed) */ return EXIT_SUCCESS; }