mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 01:09:24 -04:00
Fix the build by updating the patch.
This commit is contained in:
parent
2e5c6f0fd8
commit
088e5a33ab
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=518604
1 changed files with 18 additions and 43 deletions
|
@ -1,35 +1,18 @@
|
||||||
--- deps/hiredis/net.c.orig 2019-09-25 10:40:18 UTC
|
--- deps/hiredis/net.c.orig 2019-11-28 14:32:05.942453000 -0500
|
||||||
+++ deps/hiredis/net.c
|
+++ deps/hiredis/net.c 2019-11-28 14:39:08.326408000 -0500
|
||||||
@@ -135,13 +135,12 @@ int redisKeepAlive(redisContext *c, int interval) {
|
@@ -178,14 +178,34 @@
|
||||||
|
|
||||||
val = interval;
|
|
||||||
|
|
||||||
-#ifdef _OSX
|
|
||||||
+#if defined(_OSX)
|
|
||||||
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &val, sizeof(val)) < 0) {
|
|
||||||
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
}
|
}
|
||||||
-#else
|
-#else
|
||||||
-#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__)
|
-#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__)
|
||||||
+#elif defined(__GLIBC__)
|
+#elif defined(__GLIBC__)
|
||||||
val = interval;
|
|
||||||
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
|
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
|
||||||
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
@@ -160,6 +159,27 @@ int redisKeepAlive(redisContext *c, int interval) {
|
|
||||||
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
}
|
}
|
||||||
+#else
|
|
||||||
+#if !defined(__sun) && defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && \
|
val = interval/3;
|
||||||
+ defined(TCP_KEEPCNT)
|
|
||||||
+ val = interval;
|
|
||||||
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
|
|
||||||
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
|
||||||
+ return REDIS_ERR;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ val = interval/3;
|
|
||||||
+ if (val == 0) val = 1;
|
+ if (val == 0) val = 1;
|
||||||
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
|
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
|
||||||
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
|
@ -41,24 +24,16 @@
|
||||||
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
+ return REDIS_ERR;
|
+ return REDIS_ERR;
|
||||||
+ }
|
+ }
|
||||||
#endif
|
+#else
|
||||||
#endif
|
+#if !defined(__sun) && defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTL) && \
|
||||||
|
+ defined(TCP_KEEPCNT)
|
||||||
@@ -431,7 +451,7 @@ int redisContextConnectUnix(redisContext *c, const cha
|
+ val = interval;
|
||||||
struct sockaddr_un sa;
|
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
|
||||||
long timeout_msec = -1;
|
+ __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
|
+ return REDIS_ERR;
|
||||||
- if (redisCreateSocket(c,AF_LOCAL) < 0)
|
+ }
|
||||||
+ if (redisCreateSocket(c,AF_UNIX) < 0)
|
+
|
||||||
return REDIS_ERR;
|
+ val = internal/3;
|
||||||
if (redisSetBlocking(c,0) != REDIS_OK)
|
if (val == 0) val = 1;
|
||||||
return REDIS_ERR;
|
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
|
||||||
@@ -456,7 +476,7 @@ int redisContextConnectUnix(redisContext *c, const cha
|
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
|
||||||
if (redisContextTimeoutMsec(c,&timeout_msec) != REDIS_OK)
|
|
||||||
return REDIS_ERR;
|
|
||||||
|
|
||||||
- sa.sun_family = AF_LOCAL;
|
|
||||||
+ sa.sun_family = AF_UNIX;
|
|
||||||
strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1);
|
|
||||||
if (connect(c->fd, (struct sockaddr*)&sa, sizeof(sa)) == -1) {
|
|
||||||
if (errno == EINPROGRESS && !blocking) {
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue