summaryrefslogtreecommitdiff
path: root/src/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-07 02:34:17 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-07 02:34:17 +0200
commit0e098b15c76e222f7de381203c0c35a75a5b2f24 (patch)
tree864b2b06696c7fcc4d0c29daa3121574c52f004b /src/execute.c
parente983b76024342278a0377eae116c925f2567776e (diff)
util: never use sizeof(sa_family_t) when calculating sockaddr sizes
Diffstat (limited to 'src/execute.c')
-rw-r--r--src/execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/execute.c b/src/execute.c
index 755b4700fc..6db048c5fc 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -174,7 +174,7 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
sa.sa.sa_family = AF_UNIX;
strncpy(sa.un.sun_path+1, LOGGER_SOCKET, sizeof(sa.un.sun_path)-1);
- if (connect(fd, &sa.sa, sizeof(sa_family_t) + 1 + sizeof(LOGGER_SOCKET) - 1) < 0) {
+ if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + sizeof(LOGGER_SOCKET) - 1) < 0) {
close_nointr_nofail(fd);
return -errno;
}