summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-30 11:27:29 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-31 19:09:20 +0100
commita47806fafaec9a52a80e1795ad880b9b5008c4b8 (patch)
tree8f9c02f746975563ff4050f0b3dfffad0cbc76d1 /src/libsystemd/sd-daemon
parentcacea34bd161c31491349387db913b30508b6f11 (diff)
sd-daemon: increase sd_notify() socket buffer size
Let's make sure we don't start blocking on sd_notify() earlier than necessary, let's bump the socket buffer sizes to 8M. We already do something similar for our logging socket buffers, hence apply a similar bump here.
Diffstat (limited to 'src/libsystemd/sd-daemon')
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 77b5dd52f6..c7887804df 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -44,6 +44,8 @@
#include "strv.h"
#include "util.h"
+#define SNDBUF_SIZE (8*1024*1024)
+
static void unsetenv_all(bool unset_environment) {
if (!unset_environment)
@@ -440,6 +442,8 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
goto finish;
}
+ fd_inc_sndbuf(fd, SNDBUF_SIZE);
+
iovec.iov_len = strlen(state);
strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));