mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
unposted: stupid -a bug
This commit is contained in:
parent
41e0546a58
commit
cb0f8a08c7
2 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
2001-09-10 Clint Adams <clint@zsh.org>
|
2001-09-10 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
|
* unposted: Src/Modules/tcp.c:
|
||||||
|
don't segfault on -a if
|
||||||
|
the session table is empty.
|
||||||
|
|
||||||
* 15772: Src/Modules/tcp.c:
|
* 15772: Src/Modules/tcp.c:
|
||||||
add -t (test) for ztcp.
|
add -t (test) for ztcp.
|
||||||
|
|
||||||
|
|
|
@ -309,13 +309,12 @@ zts_byfd(int fd)
|
||||||
|
|
||||||
tsess = zts_head();
|
tsess = zts_head();
|
||||||
|
|
||||||
do {
|
while(tsess != NULL) {
|
||||||
if (tsess->fd == fd)
|
if (tsess->fd == fd)
|
||||||
return tsess;
|
return tsess;
|
||||||
|
|
||||||
tsess = zts_next(tsess);
|
tsess = zts_next(tsess);
|
||||||
}
|
}
|
||||||
while(tsess != NULL);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -387,7 +386,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func)
|
||||||
char **addrp, *desthost, *localname, *remotename;
|
char **addrp, *desthost, *localname, *remotename;
|
||||||
struct hostent *zthost = NULL, *ztpeer = NULL;
|
struct hostent *zthost = NULL, *ztpeer = NULL;
|
||||||
struct servent *srv;
|
struct servent *srv;
|
||||||
Tcp_session sess;
|
Tcp_session sess = NULL;
|
||||||
|
|
||||||
if (ops['f'])
|
if (ops['f'])
|
||||||
force = 1;
|
force = 1;
|
||||||
|
@ -502,7 +501,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func)
|
||||||
|
|
||||||
sess = zts_byfd(lfd);
|
sess = zts_byfd(lfd);
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
zwarnnam(nam, "fd is not registered as a tcp connection", NULL, 0);
|
zwarnnam(nam, "fd %s is not registered as a tcp connection", args[0], 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue