diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2016-05-07 19:17:44 +0300 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2016-05-07 19:17:44 +0300 |
commit | 5ab42bc85a11a5250dcdf8e86291d3da90aa84bd (patch) | |
tree | 1493f86c5031484546ab98d242303101d3b43017 /src/basic/log.c | |
parent | d2cc96a8e134e8166acb917f67b3e8b308e09370 (diff) | |
parent | 23be5709e10b3b88a9908f3005351ccba9e5d48b (diff) |
Merge pull request #3191 from poettering/cgroups-agent-dgram
core: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notification
Diffstat (limited to 'src/basic/log.c')
-rw-r--r-- | src/basic/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index d89e6f7274..3ea643b6e6 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -165,7 +165,7 @@ static int log_open_syslog(void) { goto fail; } - if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) { + if (connect(syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) { safe_close(syslog_fd); /* Some legacy syslog systems still use stream @@ -177,7 +177,7 @@ static int log_open_syslog(void) { goto fail; } - if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) { + if (connect(syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) { r = -errno; goto fail; } @@ -215,7 +215,7 @@ static int log_open_journal(void) { goto fail; } - if (connect(journal_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) { + if (connect(journal_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) { r = -errno; goto fail; } |