Add support for SOCKS if enabled.

Remove a useless bind() call (why did that ever get in there?)
This commit is contained in:
Paul Traina 1996-04-23 06:01:10 +00:00
parent 33bb8564be
commit d9fd44dd79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15359
2 changed files with 11 additions and 4 deletions

View file

@ -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>

View file

@ -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) {