[Python-checkins] CVS: python/dist/src/Modules getaddrinfo.c,1.7,1.8

Martin v. L?wis loewis@users.sourceforge.net
Fri, 07 Sep 2001 09:10:02 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv11530

Modified Files:
	getaddrinfo.c 
Log Message:
Fix compiler warnings. This closes some of the #458880 problem.


Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** getaddrinfo.c	2001/08/30 14:15:38	1.7
--- getaddrinfo.c	2001/09/07 16:10:00	1.8
***************
*** 237,244 ****
  
  int
! getaddrinfo(hostname, servname, hints, res)
! 	const char *hostname, *servname;
! 	const struct addrinfo *hints;
! 	struct addrinfo **res;
  {
  	struct addrinfo sentinel;
--- 237,242 ----
  
  int
! getaddrinfo(const char*hostname, const char*servname,
!             const struct addrinfo *hints, struct addrinfo **res)
  {
  	struct addrinfo sentinel;
***************
*** 368,380 ****
  				ERR(EAI_SERVICE);
  			port = sp->s_port;
! 			if (pai->ai_socktype == GAI_ANY)
  				if (strcmp(sp->s_proto, "udp") == 0) {
  					pai->ai_socktype = SOCK_DGRAM;
  					pai->ai_protocol = IPPROTO_UDP;
  				} else if (strcmp(sp->s_proto, "tcp") == 0) {
! 					pai->ai_socktype = SOCK_STREAM;
! 					pai->ai_protocol = IPPROTO_TCP;
! 				} else
! 					ERR(EAI_PROTOCOL);	/*xxx*/
  		}
  	}
--- 366,379 ----
  				ERR(EAI_SERVICE);
  			port = sp->s_port;
! 			if (pai->ai_socktype == GAI_ANY) {
  				if (strcmp(sp->s_proto, "udp") == 0) {
  					pai->ai_socktype = SOCK_DGRAM;
  					pai->ai_protocol = IPPROTO_UDP;
  				} else if (strcmp(sp->s_proto, "tcp") == 0) {
!                                         pai->ai_socktype = SOCK_STREAM;
!                                         pai->ai_protocol = IPPROTO_TCP;
!                                 } else
!                                         ERR(EAI_PROTOCOL);	/*xxx*/
!                         }
  		}
  	}