diff options
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c index 282340eef..793dbaa83 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1180,6 +1180,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt) channel->ch_part[PART_OUT].ch_mode = opt->jo_out_mode; if (opt->jo_set & JO_ERR_MODE) channel->ch_part[PART_ERR].ch_mode = opt->jo_err_mode; + channel->ch_nonblock = opt->jo_noblock; if (opt->jo_set & JO_TIMEOUT) for (part = PART_SOCK; part < PART_COUNT; ++part) @@ -3677,7 +3678,7 @@ channel_any_keep_open() channel_set_nonblock(channel_T *channel, ch_part_T part) { chanpart_T *ch_part = &channel->ch_part[part]; - int fd = ch_part->ch_fd; + int fd = ch_part->ch_fd; if (fd != INVALID_FD) { @@ -3722,6 +3723,9 @@ channel_send( return FAIL; } + if (channel->ch_nonblock && !ch_part->ch_nonblocking) + channel_set_nonblock(channel, part); + if (ch_log_active()) { ch_log_lead("SEND ", channel, part); @@ -4553,6 +4557,12 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) == FAIL) return FAIL; } + else if (STRCMP(hi->hi_key, "noblock") == 0) + { + if (!(supported & JO_MODE)) + break; + opt->jo_noblock = get_tv_number(item); + } else if (STRCMP(hi->hi_key, "in_io") == 0 || STRCMP(hi->hi_key, "out_io") == 0 || STRCMP(hi->hi_key, "err_io") == 0) |