summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index 68ac4bc299..2234ad5d57 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -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;