From 7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044 Mon Sep 17 00:00:00 2001 From: David Turner <> Date: Tue, 14 Apr 2009 14:43:24 -0700 Subject: AI 146183: am: CL 145975 am: CL 145805 Fix a bug in android/console.c that prevented the console "redir add" command from working properly Fix a bug in sock_address_init_resolve which caused a crashed when getaddrinfo() returned an error. Original author: digit Merged from: //branches/cupcake/... Original author: android-build Automated import of CL 146183 --- sockets.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sockets.h') diff --git a/sockets.h b/sockets.h index 274cf32..0dd06e2 100644 --- a/sockets.h +++ b/sockets.h @@ -228,8 +228,18 @@ int sock_address_get_ip( const SockAddress* a ); char* bufprint_sock_address( char* p, char* end, const SockAddress* a ); /* resolve a hostname or decimal IPv4/IPv6 address into a socket address. - * returns 0 on success, or -1 on failure */ -int sock_address_init_resolve( SockAddress* a, const char* hostname, uint16_t port, int preferIn6 ); + * returns 0 on success, or -1 on failure. Note that the values or errno + * set by this function are the following: + * + * EINVAL : invalid argument + * EHOSTDOWN : could not reach DNS server + * ENOENT : no host with this name, or host doesn't have any IP address + * ENOMEM : not enough memory to perform request + */ +int sock_address_init_resolve( SockAddress* a, + const char* hostname, + uint16_t port, + int preferIn6 ); /* create a new socket, return the socket number of -1 on failure */ int socket_create( SocketFamily family, SocketType type ); -- cgit v1.1