From 2f214c4f87d944aa28d53e331a67b1fd88d9840f Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Wed, 22 Jun 2011 12:50:53 +0200 Subject: [PATCH] systemd: make sure the acquired fd is in non-blocking mode The fd acquired from systemd is in blocking mode, and syslog-ng didn't explicitly set it to non-blocking, causing syslog-ng to stall. This patch changes that, explicitly enables O_NONBLOCK and O_CLOEXEC on systemd acquired fds. Reported-By: Enrico Scholz Signed-off-by: Balazs Scheidler --- modules/afsocket/afunix.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/afsocket/afunix.c b/modules/afsocket/afunix.c index cd9c205..9a4e37b 100644 --- a/modules/afsocket/afunix.c +++ b/modules/afsocket/afunix.c @@ -108,6 +108,8 @@ afunix_sd_acquire_socket(AFSocketSourceDriver *s, gint *result_fd) if (*result_fd != -1) { + g_fd_set_nonblock(*result_fd, TRUE); + g_fd_set_cloexec(*result_fd, TRUE); msg_verbose("Acquired systemd socket", evt_tag_str("filename", self->filename), evt_tag_int("systemd-sock-fd", *result_fd), -- 1.7.5.4