mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
In redisIsSupervised() use MSG_NOSIGNAL only for Linux.
This commit is contained in:
parent
ff01ce55d8
commit
f24a0bc1c5
@ -61,6 +61,11 @@
|
|||||||
#define HAVE_BACKTRACE 1
|
#define HAVE_BACKTRACE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* MSG_NOSIGNAL. */
|
||||||
|
#ifdef __linux__
|
||||||
|
#define HAVE_MSG_NOSIGNAL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Test for polling API */
|
/* Test for polling API */
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#define HAVE_EPOLL 1
|
#define HAVE_EPOLL 1
|
||||||
|
@ -3586,6 +3586,7 @@ int redisIsSupervised(void) {
|
|||||||
struct sockaddr_un su;
|
struct sockaddr_un su;
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
struct msghdr hdr;
|
struct msghdr hdr;
|
||||||
|
int sendto_flags = 0;
|
||||||
|
|
||||||
if (upstart_job == NULL && notify_socket == NULL)
|
if (upstart_job == NULL && notify_socket == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -3631,8 +3632,11 @@ int redisIsSupervised(void) {
|
|||||||
hdr.msg_iovlen = 1;
|
hdr.msg_iovlen = 1;
|
||||||
|
|
||||||
unsetenv("NOTIFY_SOCKET");
|
unsetenv("NOTIFY_SOCKET");
|
||||||
if (sendmsg(fd, &hdr, MSG_NOSIGNAL) < 0) {
|
#ifdef HAVE_MSG_NOSIGNAL
|
||||||
redisLog(REDIS_WARNING, "cannot send notification to systemd");
|
sendto_flags |= MSG_NOSIGNAL;
|
||||||
|
#endif
|
||||||
|
if (sendmsg(fd, &hdr, sendto_flags) < 0) {
|
||||||
|
redisLog(REDIS_WARNING, "Cannot send notification to systemd");
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user