diff options
author | Clint Adams <clint@users.sourceforge.net> | 2001-09-08 22:08:04 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2001-09-08 22:08:04 +0000 |
commit | 9a31296b3ef3a0101963eae3bd53e771e1150537 (patch) | |
tree | ba6bb165e4773652782d5703ceb1c75d069dfec1 /Src/Modules | |
parent | b554563ece82a257b02ca1c96e6783fa155fd0ea (diff) | |
download | zsh-9a31296b3ef3a0101963eae3bd53e771e1150537.tar.gz zsh-9a31296b3ef3a0101963eae3bd53e771e1150537.tar.xz zsh-9a31296b3ef3a0101963eae3bd53e771e1150537.zip |
1596x: ztcp -v
Diffstat (limited to 'Src/Modules')
-rw-r--r-- | Src/Modules/tcp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c index eb2d49f0b..ab87a98c0 100644 --- a/Src/Modules/tcp.c +++ b/Src/Modules/tcp.c @@ -381,13 +381,16 @@ tcp_connect(Tcp_session sess, char *addrp, struct hostent *zhost, int d_port) static int bin_ztcp(char *nam, char **args, char *ops, int func) { - int herrno, err=1, destport, force=0, len; + int herrno, err=1, destport, force=0, verbose=0, len; char **addrp, *desthost; struct hostent *zthost = NULL; Tcp_session sess; if (ops['f']) force=1; + + if (ops['v']) + verbose=1; if (ops['c']) { if (!args[0]) { @@ -473,7 +476,10 @@ bin_ztcp(char *nam, char **args, char *ops, int func) zwarnnam(nam, "connection failed: %e", NULL, errno); else { - fprintf(shout, "%s:%d is now on fd %d\n", desthost, destport, sess->fd); + if(verbose) + fprintf(shout, "%s:%d is now on fd %d\n", desthost, destport, sess->fd); + else + fprintf(shout, "%d\n", sess->fd); } zsfree(desthost); |