diff options
author | David Turner <> | 2009-04-14 14:43:24 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-14 14:43:24 -0700 |
commit | 7d9a2705e7ae6d8c4b1d9d5b4e2a67ab88c19044 (patch) | |
tree | c02694997e920cda9e6c756984436d438fc6e5bf /sockets.h | |
parent | 4735694ff99078f961876525ebbd55317956083f (diff) | |
download | external_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.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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 ); |