aboutsummaryrefslogtreecommitdiffstats
path: root/sockets.h
diff options
context:
space:
mode:
authorDavid Turner <>2009-04-14 14:43:24 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-14 14:43:24 -0700
commit7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044 (patch)
treec02694997e920cda9e6c756984436d438fc6e5bf /sockets.h
parent4735694ff99078f961876525ebbd55317956083f (diff)
downloadexternal_qemu-7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044.zip
external_qemu-7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044.tar.gz
external_qemu-7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044.tar.bz2
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
Diffstat (limited to 'sockets.h')
-rw-r--r--sockets.h14
1 files changed, 12 insertions, 2 deletions
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 );