diff --git a/library/net.c b/library/net.c index 2b21c57f16..8eeabb9fd5 100644 --- a/library/net.c +++ b/library/net.c @@ -137,7 +137,7 @@ int net_connect( int *fd, const char *host, int port ) if( ( server_host = gethostbyname( host ) ) == NULL ) return( POLARSSL_ERR_NET_UNKNOWN_HOST ); - if( ( *fd = socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) + if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) return( POLARSSL_ERR_NET_SOCKET_FAILED ); memcpy( (void *) &server_addr.sin_addr, @@ -179,7 +179,7 @@ int net_bind( int *fd, const char *bind_ip, int port ) signal( SIGPIPE, SIG_IGN ); #endif - if( ( *fd = socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) + if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 ) return( POLARSSL_ERR_NET_SOCKET_FAILED ); n = 1; @@ -259,8 +259,8 @@ int net_accept( int bind_fd, int *client_fd, void *client_ip ) int n = (int) sizeof( client_addr ); #endif - *client_fd = accept( bind_fd, (struct sockaddr *) - &client_addr, &n ); + *client_fd = (int) accept( bind_fd, (struct sockaddr *) + &client_addr, &n ); if( *client_fd < 0 ) {