Re: Bsd sockets and GCC 4.0
Re: Bsd sockets and GCC 4.0
- Subject: Re: Bsd sockets and GCC 4.0
- From: Jonas Maebe <email@hidden>
- Date: Mon, 16 May 2005 23:47:55 +0200
On 16 May 2005, at 23:39, Ryan Lum wrote:
if(bind(s, (struct sockaddr *)&sa, sizeof(sa) < 0)) {
With gcc 3.3 no problems, but it is returning -1 with 4.0. I am no
socket
expert, and any debugging advice would help.
Your code has been wrong for 10 years, it should be
if(bind(s, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
You were passing 0 as namelen parameter (since sizeof(sa) > 0). Not
sure why this would work with gcc 3 and not with 4 though.
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden