X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fexecute.c;h=556ff9bda94f4140f768b607dd3616207cba64fe;hb=e677657e8dddb33d1f1e32eda0ebc126e08a538d;hp=ee05e994450de54375aec6229097790fdcc7d840;hpb=8c7be95e5a80c4bd82d86e9640a071fd98618172;p=elogind.git diff --git a/src/execute.c b/src/execute.c index ee05e9944..556ff9bda 100644 --- a/src/execute.c +++ b/src/execute.c @@ -173,9 +173,9 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons zero(sa); sa.sa.sa_family = AF_UNIX; - strncpy(sa.un.sun_path+1, LOGGER_SOCKET, sizeof(sa.un.sun_path)-1); + strncpy(sa.un.sun_path, LOGGER_SOCKET, sizeof(sa.un.sun_path)); - if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + sizeof(LOGGER_SOCKET) - 1) < 0) { + if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + sizeof(LOGGER_SOCKET) - 1) < 0) { close_nointr_nofail(fd); return -errno; }