aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os_unix.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-05-30 01:25:25 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-06-07 00:26:21 +0200
commit698ec9eb6e97ce9038e5f95a3208b7a0ac8da805 (patch)
tree0692e508d6a455adaa59b611fee8802b0033df7e /src/nvim/os_unix.c
parentf83d733318d27ed8ad9fc7a442142ee8a74b7a39 (diff)
downloadrneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.tar.gz
rneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.tar.bz2
rneovim-698ec9eb6e97ce9038e5f95a3208b7a0ac8da805.zip
loop_close: Avoid infinite loop, and log it.
Avoids a hang, and also helps diagnose issues like: https://github.com/neovim/neovim/pull/6594#issuecomment-298321826
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r--src/nvim/os_unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index fb648fbcf8..692bcc97f4 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -141,7 +141,9 @@ void mch_exit(int r) FUNC_ATTR_NORETURN
ui_flush();
ml_close_all(true); // remove all memfiles
- event_teardown();
+ if (!event_teardown() && r == 0) {
+ r = 1; // Exit with error if main_loop did not teardown gracefully.
+ }
stream_set_blocking(input_global_fd(), true); // normalize stream (#2598)
#ifdef EXITFREE