1
0
forked from aniani/vim

patch 8.2.0694: Haiku: channel and terminal do not work

Problem:    Haiku: channel and terminal do not work.
Solution:   Close files when the job has finished. (Ozaki Kiichi,
            closes #6039)
This commit is contained in:
Bram Moolenaar
2020-05-03 22:57:32 +02:00
parent 2fd4cd755c
commit 80a8d3889b
5 changed files with 81 additions and 24 deletions

View File

@@ -3940,7 +3940,7 @@ theend:
free_job_options(&opt);
}
# if defined(MSWIN) || defined(FEAT_GUI) || defined(PROTO)
#if defined(MSWIN) || defined(__HAIKU__) || defined(FEAT_GUI) || defined(PROTO)
/*
* Check the channels for anything that is ready to be read.
* The data is put in the read queue.
@@ -3973,9 +3973,23 @@ channel_handle_events(int only_keep_open)
"channel_handle_events");
}
}
# ifdef __HAIKU__
// Workaround for Haiku: Since select/poll cannot detect EOF from tty,
// should close fds when the job has finished if 'channel' connects to
// the pty.
if (channel->ch_job != NULL)
{
job_T *job = channel->ch_job;
if (job->jv_tty_out != NULL && job->jv_status == JOB_FINISHED)
for (part = PART_SOCK; part < PART_COUNT; ++part)
ch_close_part(channel, part);
}
# endif
}
}
# endif
#endif
# if defined(FEAT_GUI) || defined(PROTO)
/*
@@ -4541,6 +4555,20 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
channel_write_input(channel);
--ret;
}
# ifdef __HAIKU__
// Workaround for Haiku: Since select/poll cannot detect EOF from tty,
// should close fds when the job has finished if 'channel' connects to
// the pty.
if (channel->ch_job != NULL)
{
job_T *job = channel->ch_job;
if (job->jv_tty_out != NULL && job->jv_status == JOB_FINISHED)
for (part = PART_SOCK; part < PART_COUNT; ++part)
ch_close_part(channel, part);
}
# endif
}
return ret;