Date: Wed, 7 Jan 2004 22:52:32 +0100 From: Christian Klein <chris@schwer.bewaff.net> To: freebsd-stable@freebsd.org Subject: Re: getsockname() Message-ID: <CBA52DA6-415B-11D8-942B-000393076EEC@schwer.bewaff.net> In-Reply-To: <MDEHLPKNGKAHNMBLJOLKKEOIJEAA.davids@webmaster.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Am Mittwoch, 07.01.04, um 22:40 Uhr (Europe/Berlin) schrieb David
Schwartz:
>
> Fix those two bugs and see if you still have a problem.
>
> DS
Ok, here's the diff of the changes:
$ diff public_html/haunted.c haunted.c
11c11
< int sock, len;
---
> int sock, len=0;
36,37c36,40
< getsockname(sock, (struct sockaddr *) &foo, &len);
< fprintf(stderr, "listening on %s:%d\n",
inet_ntoa(foo.sin_addr), ntohs(foo.sin_port));
---
> if(getsockname(sock, (struct sockaddr *) &foo, &len)<0)
> {
> perror("getsockname");
> } else
> fprintf(stderr, "listening on %s:%d\n",
inet_ntoa(foo.sin_addr), ntohs(foo.sin_port));
But still the same :-(
(BTW, the problem does not occur on my FreeBSD-current machine)
Chris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CBA52DA6-415B-11D8-942B-000393076EEC>
