summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2026-07-09 01:36:02 +0200
committerMikael Magnusson <mikachu@gmail.com>2026-07-12 01:57:56 +0200
commitb5cc027f85d54bbafde54062d27e136cc46072e3 (patch)
treefe2389e9e415896989c3e440c24b92e764630391
parent54928: W02: really close all the fds for sleep (diff)
downloadzsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar.gz
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar.bz2
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar.lz
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar.xz
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.tar.zst
zsh-b5cc027f85d54bbafde54062d27e136cc46072e3.zip
54927: checkptycmd: remove select()+FIONREAD variant, re-enable poll on osxHEADmaster
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/zpty.c33
-rw-r--r--Src/zsh_system.h9
3 files changed, 3 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 357e0ef3f..d5ade4b6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2026-07-12 Mikael Magnusson <mikachu@gmail.com>
+ * 54927: Src/Modules/zpty.c, Src/zsh_system.h: checkptycmd:
+ remove select()+FIONREAD variant, re-enable poll on osx
+
* 54928: Test/W02jobs.ztst: W02: really close all the fds
for sleep
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 2f9b80f40..1d381cdc8 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -555,39 +555,6 @@ checkptycmd(Ptycmd cmd)
cmd->fin = 1;
zclose(cmd->fd);
}
-#elif defined(FIONREAD)
-static void
-checkptycmd(Ptycmd cmd)
-{
- int val = 0, select_ret = 0;
-
- if (cmd->fin)
- return;
-#ifdef HAVE_SELECT
- {
- fd_set fds;
- struct timeval tv;
- int ret;
-
- FD_ZERO(&fds);
- FD_SET(cmd->fd, &fds);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- ret = select(cmd->fd + 1, (SELECT_ARG_2_T) &fds, NULL, NULL, &tv);
- if (ret > 0 && FD_ISSET(cmd->fd, &fds)) {
- /* either there are bytes, or the process exited */
- select_ret = 1;
- }
- }
-#endif
- if (ioctl(cmd->fd, FIONREAD, (char *) &val) == 0 && val > 0)
- return; /* data available, not finished */
- /* No data (or ioctl failed): check if process is dead */
- if (select_ret || kill(cmd->pid, 0) < 0) {
- cmd->fin = 1;
- zclose(cmd->fd);
- }
-}
#else
static void
checkptycmd(Ptycmd cmd)
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 21446a9b1..d46135e10 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -371,15 +371,6 @@ struct timespec {
# endif
#endif
-#if defined(__APPLE__) && defined(HAVE_SELECT)
-/*
- * Prefer select() to poll() on MacOS X since poll() is known
- * to be problematic in 10.4
- */
-#undef HAVE_POLL
-#undef HAVE_POLL_H
-#endif
-
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif