mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
Add support for SOCKS if enabled.
Remove a useless bind() call (why did that ever get in there?)
This commit is contained in:
parent
33bb8564be
commit
d9fd44dd79
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15359
@ -2,4 +2,11 @@
|
||||
|
||||
PROG= whois
|
||||
|
||||
.if defined(SOCKS)
|
||||
CFLAGS+=-DSOCKS
|
||||
CFLAGS+=-Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dlisten=Rlisten \
|
||||
-Daccept=Raccept -Drcmd=Rrcmd -Dbind=Rbind -Dselect=Rselect
|
||||
LDADD+= -lsocks
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -63,6 +63,10 @@ main(argc, argv)
|
||||
int s;
|
||||
char *host;
|
||||
|
||||
#ifdef SOCKS
|
||||
SOCKSinit(argv[0]);
|
||||
#endif
|
||||
|
||||
host = NICHOST;
|
||||
while ((ch = getopt(argc, argv, "h:")) != EOF)
|
||||
switch((char)ch) {
|
||||
@ -93,10 +97,6 @@ main(argc, argv)
|
||||
}
|
||||
bzero((caddr_t)&sin, sizeof (sin));
|
||||
sin.sin_family = hp->h_addrtype;
|
||||
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
|
||||
perror("whois: bind");
|
||||
exit(1);
|
||||
}
|
||||
bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
|
||||
sp = getservbyname("whois", "tcp");
|
||||
if (sp == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user