Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 9537 invoked by uid 500); 25 Dec 2001 12:26:26 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 9526 invoked from network); 25 Dec 2001 12:26:26 -0000 Date: 25 Dec 2001 12:26:26 -0000 Message-ID: <20011225122626.10055.qmail@icarus.apache.org> From: trawick@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/network_io/unix sa_common.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N trawick 01/12/25 04:26:26 Modified: network_io/unix sa_common.c Log: AIX 5L getaddrinfo() returns an error when "0" is passed for the service name parameter, so pass NULL when port is 0 Revision Changes Path 1.46 +9 -2 apr/network_io/unix/sa_common.c Index: sa_common.c =================================================================== RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- sa_common.c 2001/09/12 19:46:12 1.45 +++ sa_common.c 2001/12/25 12:26:26 1.46 @@ -342,6 +342,7 @@ apr_sockaddr_t *cursa; int error; char num[8]; + char *numptr; memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ @@ -356,8 +357,14 @@ hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - apr_snprintf(num, sizeof(num), "%d", port); - error = getaddrinfo(hostname, num, &hints, &ai_list); + if (port) { + apr_snprintf(num, sizeof(num), "%d", port); + numptr = num; + } + else { + numptr = NULL; + } + error = getaddrinfo(hostname, numptr, &hints, &ai_list); if (error) { if (error == EAI_SYSTEM) { return errno;