From 9a31296b3ef3a0101963eae3bd53e771e1150537 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sat, 8 Sep 2001 22:08:04 +0000 Subject: 1596x: ztcp -v --- Src/Modules/tcp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Src/Modules/tcp.c') 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); -- cgit v1.2.3