aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os_unix.c
diff options
context:
space:
mode:
authorJakob Schnitzer <mail@jakobschnitzer.de>2017-06-28 16:52:04 +0200
committerJakob Schnitzer <mail@jakobschnitzer.de>2017-06-28 16:52:04 +0200
commite8829710bc5f38208499e0ad38402eac24a67ac2 (patch)
tree4e1ae954c2e301adadbfa7038b823ea9ea2fb08e /src/nvim/os_unix.c
parentff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (diff)
parentf0dafa89c2b7602cfedf0bd3409858e4c212b0a2 (diff)
downloadrneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.gz
rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.tar.bz2
rneovim-e8829710bc5f38208499e0ad38402eac24a67ac2.zip
Merge branch 'master' into option-fixes
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r--src/nvim/os_unix.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index c5a42204be..692bcc97f4 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -133,7 +133,7 @@ void mch_free_acl(vim_acl_T aclent)
}
#endif
-void mch_exit(int r)
+void mch_exit(int r) FUNC_ATTR_NORETURN
{
exiting = true;
@@ -141,7 +141,9 @@ void mch_exit(int r)
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
@@ -173,7 +175,7 @@ void mch_exit(int r)
/// @returns OK for success or FAIL for error.
int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
char_u ***file, int flags) FUNC_ATTR_NONNULL_ARG(3)
- FUNC_ATTR_NONNULL_ARG(4)
+ FUNC_ATTR_NONNULL_ARG(4)
{
int i;
size_t len;