Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f24a0bc1
Commit
f24a0bc1
authored
Dec 11, 2014
by
antirez
Browse files
In redisIsSupervised() use MSG_NOSIGNAL only for Linux.
parent
ff01ce55
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.h
View file @
f24a0bc1
...
...
@@ -61,6 +61,11 @@
#define HAVE_BACKTRACE 1
#endif
/* MSG_NOSIGNAL. */
#ifdef __linux__
#define HAVE_MSG_NOSIGNAL 1
#endif
/* Test for polling API */
#ifdef __linux__
#define HAVE_EPOLL 1
...
...
src/redis.c
View file @
f24a0bc1
...
...
@@ -3586,6 +3586,7 @@ int redisIsSupervised(void) {
struct
sockaddr_un
su
;
struct
iovec
iov
;
struct
msghdr
hdr
;
int
sendto_flags
=
0
;
if
(
upstart_job
==
NULL
&&
notify_socket
==
NULL
)
return
0
;
...
...
@@ -3631,8 +3632,11 @@ int redisIsSupervised(void) {
hdr
.
msg_iovlen
=
1
;
unsetenv
(
"NOTIFY_SOCKET"
);
if
(
sendmsg
(
fd
,
&
hdr
,
MSG_NOSIGNAL
)
<
0
)
{
redisLog
(
REDIS_WARNING
,
"cannot send notification to systemd"
);
#ifdef HAVE_MSG_NOSIGNAL
sendto_flags
|=
MSG_NOSIGNAL
;
#endif
if
(
sendmsg
(
fd
,
&
hdr
,
sendto_flags
)
<
0
)
{
redisLog
(
REDIS_WARNING
,
"Cannot send notification to systemd"
);
close
(
fd
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment