| Index: runtime/bin/socket_android.cc
|
| ===================================================================
|
| --- runtime/bin/socket_android.cc (revision 14903)
|
| +++ runtime/bin/socket_android.cc (working copy)
|
| @@ -9,6 +9,7 @@
|
| #include <unistd.h>
|
|
|
| #include "bin/fdutils.h"
|
| +#include "bin/log.h"
|
| #include "bin/socket.h"
|
|
|
|
|
| @@ -25,7 +26,7 @@
|
|
|
| fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
|
| if (fd < 0) {
|
| - fprintf(stderr, "Error CreateConnect: %s\n", strerror(errno));
|
| + Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
|
| return -1;
|
| }
|
|
|
| @@ -34,7 +35,7 @@
|
| server = gethostbyname(host);
|
| if (server == NULL) {
|
| TEMP_FAILURE_RETRY(close(fd));
|
| - fprintf(stderr, "Error CreateConnect: %s\n", strerror(errno));
|
| + Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
|
| return -1;
|
| }
|
|
|
| @@ -92,7 +93,7 @@
|
| getsockname(fd,
|
| reinterpret_cast<struct sockaddr *>(&socket_address),
|
| &size))) {
|
| - fprintf(stderr, "Error getsockname: %s\n", strerror(errno));
|
| + Log::PrintErr("Error getsockname: %s\n", strerror(errno));
|
| return 0;
|
| }
|
| return ntohs(socket_address.sin_port);
|
| @@ -107,14 +108,14 @@
|
| getpeername(fd,
|
| reinterpret_cast<struct sockaddr *>(&socket_address),
|
| &size))) {
|
| - fprintf(stderr, "Error getpeername: %s\n", strerror(errno));
|
| + Log::PrintErr("Error getpeername: %s\n", strerror(errno));
|
| return false;
|
| }
|
| if (inet_ntop(socket_address.sin_family,
|
| reinterpret_cast<const void *>(&socket_address.sin_addr),
|
| host,
|
| INET_ADDRSTRLEN) == NULL) {
|
| - fprintf(stderr, "Error inet_ntop: %s\n", strerror(errno));
|
| + Log::PrintErr("Error inet_ntop: %s\n", strerror(errno));
|
| return false;
|
| }
|
| *port = ntohs(socket_address.sin_port);
|
| @@ -184,7 +185,7 @@
|
|
|
| fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
|
| if (fd < 0) {
|
| - fprintf(stderr, "Error CreateBind: %s\n", strerror(errno));
|
| + Log::PrintErr("Error CreateBind: %s\n", strerror(errno));
|
| return -1;
|
| }
|
|
|
| @@ -202,12 +203,12 @@
|
| reinterpret_cast<struct sockaddr *>(&server_address),
|
| sizeof(server_address))) < 0) {
|
| TEMP_FAILURE_RETRY(close(fd));
|
| - fprintf(stderr, "Error Bind: %s\n", strerror(errno));
|
| + Log::PrintErr("Error Bind: %s\n", strerror(errno));
|
| return -1;
|
| }
|
|
|
| if (TEMP_FAILURE_RETRY(listen(fd, backlog)) != 0) {
|
| - fprintf(stderr, "Error Listen: %s\n", strerror(errno));
|
| + Log::PrintErr("Error Listen: %s\n", strerror(errno));
|
| return -1;
|
| }
|
|
|
|
|