mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Revert "Speed up 'read', fixing macOS hang"
This reverts commit ff385e5a89
.
It broke Solaris and illumos. More testing is needed.
This commit is contained in:
parent
ff385e5a89
commit
569c1bb9c1
4 changed files with 232 additions and 40 deletions
|
@ -583,19 +583,5 @@ then exec 3>&-
|
|||
err_exit "Open file descriptor leaks out of subshell"
|
||||
fi
|
||||
|
||||
# ======
|
||||
# On unpatched ksh on macOS, 'read' used to block when reading from a FIFO and there was no final newline.
|
||||
if mkfifo "$tmp/fifo_no_lf"
|
||||
then trap 'sleep_pid=0; kill "$ksh_pid"; err_exit "'\''read'\'' hangs on EOF without final linefeed when reading from FIFO"' TERM
|
||||
(sleep 1; kill "$$") &
|
||||
sleep_pid=$!
|
||||
"$SHELL" -c 'print -n foo >$0 & while read f; do :; done <$0' "$tmp/fifo_no_lf" &
|
||||
ksh_pid=$!
|
||||
wait "$ksh_pid"
|
||||
trap - TERM
|
||||
((sleep_pid)) && kill "$sleep_pid"
|
||||
else err_exit "mkfifo failed; cannot test reading from FIFO"
|
||||
fi
|
||||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue