diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-17 00:46:34 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-17 00:46:34 -0300 |
commit | 883b78d29864f39b8032468c4374766dad7d142f (patch) | |
tree | b555f3a48c08862c07ef7518a8ba6c8fa58c1aee /src/nvim/os/stream.c | |
parent | d88c93acf390ea9d5e8674283927cff60fb41e0d (diff) | |
parent | aa9cb48bf08af14068178619414590254b263882 (diff) | |
download | rneovim-883b78d29864f39b8032468c4374766dad7d142f.tar.gz rneovim-883b78d29864f39b8032468c4374766dad7d142f.tar.bz2 rneovim-883b78d29864f39b8032468c4374766dad7d142f.zip |
Merge PR #2980 'Refactor event loop layer'
Helped-by: oni-link <knil.ino@gmail.com>
Reviewed-by: oni-link <knil.ino@gmail.com>
Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
Diffstat (limited to 'src/nvim/os/stream.c')
-rw-r--r-- | src/nvim/os/stream.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/nvim/os/stream.c b/src/nvim/os/stream.c deleted file mode 100644 index 0c448872c3..0000000000 --- a/src/nvim/os/stream.c +++ /dev/null @@ -1,30 +0,0 @@ -// Functions for working with stdio streams (as opposed to RStream/WStream). - -#include <stdio.h> -#include <stdbool.h> - -#include <uv.h> - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/stream.c.generated.h" -#endif - -/// Sets the stream associated with `fd` to "blocking" mode. -/// -/// @return `0` on success, or `-errno` on failure. -int stream_set_blocking(int fd, bool blocking) -{ - // Private loop to avoid conflict with existing watcher(s): - // uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed. - uv_loop_t loop; - uv_pipe_t stream; - uv_loop_init(&loop); - uv_pipe_init(&loop, &stream, 0); - uv_pipe_open(&stream, fd); - int retval = uv_stream_set_blocking((uv_stream_t *)&stream, blocking); - uv_close((uv_handle_t *)&stream, NULL); - uv_run(&loop, UV_RUN_NOWAIT); // not necessary, but couldn't hurt. - uv_loop_close(&loop); - return retval; -} - |