diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-05-25 14:13:18 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-05-27 09:34:04 -0400 |
commit | 4219b69145f13e95eadb5a666cb02b482bdd395b (patch) | |
tree | 5684a6cb585e60372d41144a4ae13eee8aaab710 /src/nvim/main.c | |
parent | 8a782f1699e2a59a3f3e91f6d7c35a3312b82b41 (diff) | |
download | rneovim-4219b69145f13e95eadb5a666cb02b482bdd395b.tar.gz rneovim-4219b69145f13e95eadb5a666cb02b482bdd395b.tar.bz2 rneovim-4219b69145f13e95eadb5a666cb02b482bdd395b.zip |
input: stream_set_blocking(): libuv impl
- Create a private libuv loop instead of re-using uv_default_loop(), to
avoid conflict[1] with existing watcher(s) on the fd.
- Expose the global "input" fd as a getter instead of a mutable global.
[1] .deps/build/src/libuv/src/unix/core.c:833:
uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 6ae96a7c69..4714de7c59 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -273,13 +273,13 @@ int main(int argc, char **argv) if (reading_input) { // One of the startup commands (arguments, sourced scripts or plugins) may // prompt the user, so start reading from a tty now. - global_input_fd = fileno(stdin); + int fd = fileno(stdin); if (!params.input_isatty || params.edit_type == EDIT_STDIN) { // Use stderr or stdout since stdin is not a tty and/or could be used to // read the "-" file (eg: cat file | nvim -) - global_input_fd = params.err_isatty ? fileno(stderr) : fileno(stdout); + fd = params.err_isatty ? fileno(stderr) : fileno(stdout); } - input_start_stdin(global_input_fd); + input_start_stdin(fd); } // open terminals when opening files that start with term:// |