diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2003-07-04 16:27:36 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2003-07-04 16:27:36 +0000 |
commit | 554605ee04946160e360354c4aee9102c877ac19 (patch) | |
tree | 0488e3d86aefe4a93707e44a5b267a5379cb4393 /Functions/TCP/tcp_send | |
parent | e50b688cd5d246a6134fe614ae4efdf9e7dd649e (diff) | |
download | zsh-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_send')
-rw-r--r-- | Functions/TCP/tcp_send | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Functions/TCP/tcp_send b/Functions/TCP/tcp_send index e7dfca771..c5f902f71 100644 --- a/Functions/TCP/tcp_send +++ b/Functions/TCP/tcp_send @@ -3,6 +3,7 @@ setopt extendedglob cbases local opt quiet all sess fd nonewline local -a sessions write_fds +integer mystat while getopts "al:nqs:" opt; do case $opt in @@ -56,6 +57,11 @@ local TCP_SESS for TCP_SESS in $sessions; do fd=${tcp_by_name[$TCP_SESS]} + if [[ -z $fd ]]; then + print "No such session: $TCP_SESS" >&2 + mystat=1 + continue + fi print $nonewline -r -- $* >&$fd if [[ $? -ne 0 || -n $TCP_FD_CLOSED ]]; then print "Session ${TCP_SESS}: fd $fd unusable." >&2 @@ -65,3 +71,5 @@ for TCP_SESS in $sessions; do tcp_output -P "$TCP_OUTPUT" -S $TCP_SESS -F $fd -q "${(j. .)*}" fi done + +return $mystat |