From 28dafe3ff0b0dc082fb62b2251fd64a167ce7188 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 21 Aug 2016 08:16:47 +0300 Subject: eval,*: Move get_tv_string to typval.c Function was renamed and changed to return `const char *`. --- src/nvim/os_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index ed3410ffe5..acd86f06dc 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -110,14 +110,14 @@ void mch_copy_sec(char_u *from_file, char_u *to_file) // Return a pointer to the ACL of file "fname" in allocated memory. // Return NULL if the ACL is not available for whatever reason. -vim_acl_T mch_get_acl(char_u *fname) +vim_acl_T mch_get_acl(const char_u *fname) { vim_acl_T ret = NULL; return ret; } // Set the ACL of file "fname" to "acl" (unless it's NULL). -void mch_set_acl(char_u *fname, vim_acl_T aclent) +void mch_set_acl(const char_u *fname, vim_acl_T aclent) { if (aclent == NULL) return; -- cgit From c2f3e361c52ec4e7149ea1d8c6a1202e0873da8e Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:50 +0300 Subject: *: Add comment to all C files --- src/nvim/os_unix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index acd86f06dc..c5a42204be 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * os_unix.c -- code for all flavors of Unix (BSD, SYSV, SVR4, POSIX, ...) * -- cgit From 63ad4caab52c191d58802ecfe5d16fab5761fc1c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 20 Apr 2017 01:13:24 -0400 Subject: os_unix: Mark mch_exit as NORETURN --- src/nvim/os_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index c5a42204be..7cf0d7817c 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; -- cgit From 3f553ac0b9b3866f1254e669eb0c1c019c789a60 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Fri, 2 Jun 2017 15:42:37 +0200 Subject: lint: fix indentation of FUNC_ATTR lines --- src/nvim/os_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 7cf0d7817c..fb648fbcf8 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -173,7 +173,7 @@ void mch_exit(int r) FUNC_ATTR_NORETURN /// @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; -- cgit From 698ec9eb6e97ce9038e5f95a3208b7a0ac8da805 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 May 2017 01:25:25 +0200 Subject: 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 --- src/nvim/os_unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/os_unix.c') 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 -- cgit From 85bc6630c0a8259c713383c8787e65f92e24e600 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 6 Sep 2017 08:16:59 +0200 Subject: input: only change mode of input fd if there is an input fd --- src/nvim/os_unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/os_unix.c') diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index 692bcc97f4..d7ba675b68 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -144,7 +144,9 @@ void mch_exit(int r) FUNC_ATTR_NORETURN 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) + if (input_global_fd() >= 0) { + stream_set_blocking(input_global_fd(), true); // normalize stream (#2598) + } #ifdef EXITFREE free_all_mem(); -- cgit