about summary refs log tree commit diff
path: root/Functions/TCP/tcp_wait
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-07-04 16:27:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-07-04 16:27:36 +0000
commit554605ee04946160e360354c4aee9102c877ac19 (patch)
tree0488e3d86aefe4a93707e44a5b267a5379cb4393 /Functions/TCP/tcp_wait
parente50b688cd5d246a6134fe614ae4efdf9e7dd649e (diff)
downloadzsh-554605ee04946160e360354c4aee9102c877ac19.tar.gz
zsh-554605ee04946160e360354c4aee9102c877ac19.tar.xz
zsh-554605ee04946160e360354c4aee9102c877ac19.zip
18810: Various enhancements and bug fixes for the TCP function suite
Diffstat (limited to 'Functions/TCP/tcp_wait')
-rw-r--r--Functions/TCP/tcp_wait9
1 files changed, 8 insertions, 1 deletions
diff --git a/Functions/TCP/tcp_wait b/Functions/TCP/tcp_wait
index d18068a66..ee04cf23b 100644
--- a/Functions/TCP/tcp_wait
+++ b/Functions/TCP/tcp_wait
@@ -1,7 +1,14 @@
 # Wait for given number of seconds, reading any data from
 # all TCP connections while doing so.
 
-typeset -F SECONDS to end
+if [[ ${(t)SECONDS} != float* ]]; then
+    # If called from tcp_expect, don't override
+    typeset -F TCP_SECONDS_START=$SECONDS
+    # Get extra accuracy by making SECONDS floating point locally
+    typeset -F SECONDS
+fi
+
+typeset to end
 
 (( to = $1, end = SECONDS + to ))
 while (( SECONDS < end )); do