mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-27 00:57:50 +00:00
- close socket if poll/select failed
- bump PORTREVISION Submitted by: vanilla
This commit is contained in:
parent
8934acfb2e
commit
95ed7e38b1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221931
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= libmemcached
|
||||
PORTVERSION= 0.23
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= http://download.tangent.org/
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
--- libmemcached/memcached_connect.c.orig 2008-10-23 06:19:25.000000000 -0700
|
||||
+++ libmemcached/memcached_connect.c 2008-10-23 06:23:16.000000000 -0700
|
||||
@@ -225,6 +225,7 @@
|
||||
{
|
||||
struct pollfd fds[1];
|
||||
int error;
|
||||
+ socklen_t len;
|
||||
|
||||
memset(&fds, 0, sizeof(struct pollfd));
|
||||
fds[0].fd= ptr->fd;
|
||||
@@ -237,6 +238,7 @@
|
||||
}
|
||||
else if (error != 1 || fds[0].revents & POLLERR)
|
||||
{
|
||||
+closesock:
|
||||
ptr->cached_errno= errno;
|
||||
WATCHPOINT_ERRNO(ptr->cached_errno);
|
||||
WATCHPOINT_NUMBER(ptr->root->connect_timeout);
|
||||
@@ -259,6 +261,13 @@
|
||||
return MEMCACHED_ERRNO;
|
||||
}
|
||||
|
||||
+ len = sizeof (error);
|
||||
+ if (getsockopt (ptr->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0)
|
||||
+ goto closesock;
|
||||
+
|
||||
+ if (error > 0)
|
||||
+ goto closesock;
|
||||
+
|
||||
break;
|
||||
}
|
||||
/* We are spinning waiting on connect */
|
Loading…
Reference in New Issue
Block a user