Mercurial > mplayer.hg
comparison libmpdemux/network.c @ 9900:f36b9dda3082
Use inet_ntoa where inet_ntop is not available.
author | bertrand |
---|---|
date | Thu, 10 Apr 2003 10:55:18 +0000 |
parents | 237fcb766110 |
children | 6cb7a295ab0e |
comparison
equal
deleted
inserted
replaced
9899:248c478a0699 | 9900:f36b9dda3082 |
---|---|
251 default: | 251 default: |
252 mp_msg(MSGT_NETWORK,MSGL_ERR, "Unknown address family %d:\n", af); | 252 mp_msg(MSGT_NETWORK,MSGL_ERR, "Unknown address family %d:\n", af); |
253 return -2; | 253 return -2; |
254 } | 254 } |
255 | 255 |
256 inet_ntop(af, our_s_addr, buf, 255); | 256 #ifdef USE_ATON |
257 strncpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255); | |
258 #else | |
259 inet_ntop(af, our_s_addr, buf, 255); | |
260 #endif | |
257 mp_msg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]:%d ...\n", host, buf , port ); | 261 mp_msg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]:%d ...\n", host, buf , port ); |
258 | 262 |
259 // Turn the socket as non blocking so we can timeout on the connection | 263 // Turn the socket as non blocking so we can timeout on the connection |
260 fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) | O_NONBLOCK ); | 264 fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) | O_NONBLOCK ); |
261 if( connect( socket_server_fd, (struct sockaddr*)&server_address, server_address_size )==-1 ) { | 265 if( connect( socket_server_fd, (struct sockaddr*)&server_address, server_address_size )==-1 ) { |