mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
input: only change mode of input fd if there is an input fd
This commit is contained in:
@@ -778,7 +778,6 @@ err_closing:
|
|||||||
if (execl("/bin/sh", "sh", "-c", cmd, (char *)NULL) == -1)
|
if (execl("/bin/sh", "sh", "-c", cmd, (char *)NULL) == -1)
|
||||||
PERROR(_("cs_create_connection exec failed"));
|
PERROR(_("cs_create_connection exec failed"));
|
||||||
|
|
||||||
stream_set_blocking(input_global_fd(), true); // normalize stream (#2598)
|
|
||||||
exit(127);
|
exit(127);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
default: /* parent. */
|
default: /* parent. */
|
||||||
|
@@ -2622,7 +2622,10 @@ void preserve_exit(void)
|
|||||||
|
|
||||||
// Prevent repeated calls into this method.
|
// Prevent repeated calls into this method.
|
||||||
if (really_exiting) {
|
if (really_exiting) {
|
||||||
stream_set_blocking(input_global_fd(), true); //normalize stream (#2598)
|
if (input_global_fd() >= 0) {
|
||||||
|
// normalize stream (#2598)
|
||||||
|
stream_set_blocking(input_global_fd(), true);
|
||||||
|
}
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ typedef enum {
|
|||||||
static Stream read_stream = {.closed = true};
|
static Stream read_stream = {.closed = true};
|
||||||
static RBuffer *input_buffer = NULL;
|
static RBuffer *input_buffer = NULL;
|
||||||
static bool input_eof = false;
|
static bool input_eof = false;
|
||||||
static int global_fd = 0;
|
static int global_fd = -1;
|
||||||
static int events_enabled = 0;
|
static int events_enabled = 0;
|
||||||
static bool blocking = false;
|
static bool blocking = false;
|
||||||
|
|
||||||
|
@@ -144,7 +144,9 @@ void mch_exit(int r) FUNC_ATTR_NORETURN
|
|||||||
if (!event_teardown() && r == 0) {
|
if (!event_teardown() && r == 0) {
|
||||||
r = 1; // Exit with error if main_loop did not teardown gracefully.
|
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
|
#ifdef EXITFREE
|
||||||
free_all_mem();
|
free_all_mem();
|
||||||
|
Reference in New Issue
Block a user