execute: use right logger socket

This commit is contained in:
Lennart Poettering 2010-07-11 04:38:40 +02:00
parent 983d9c9015
commit b5f776cee9

View file

@ -171,7 +171,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)) < 0) {
if (connect(fd, &sa.sa, sizeof(sa_family_t) + 1 + sizeof(LOGGER_SOCKET) - 1) < 0) {
close_nointr_nofail(fd);
return -errno;
}