summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/socket.c b/src/socket.c
index 5372510d0..25b909475 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -255,7 +255,7 @@ static void connSocketEventHandler(struct aeEventLoop *el, int fd, void *clientD
if (conn->state == CONN_STATE_CONNECTING &&
(mask & AE_WRITABLE) && conn->conn_handler) {
- int conn_error = connGetSocketError(conn);
+ int conn_error = anetGetError(conn->fd);
if (conn_error) {
conn->last_errno = conn_error;
conn->state = CONN_STATE_ERROR;
@@ -358,16 +358,6 @@ ConnectionType CT_Socket = {
.get_type = connSocketGetType
};
-
-int connGetSocketError(connection *conn) {
- int sockerr = 0;
- socklen_t errlen = sizeof(sockerr);
-
- if (getsockopt(conn->fd, SOL_SOCKET, SO_ERROR, &sockerr, &errlen) == -1)
- sockerr = errno;
- return sockerr;
-}
-
int connPeerToString(connection *conn, char *ip, size_t ip_len, int *port) {
if (anetFdToString(conn ? conn->fd : -1, ip, ip_len, port, FD_TO_PEER_NAME) == -1) {
if (conn) conn->last_errno = errno;