From 4fa261f8ecb16fabb4d06403f6ffacaa010ce453 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 19 May 2009 22:39:45 +0000 Subject: Fix possible system freeze on Mac OS X. --- jnlib/logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jnlib/logging.c') diff --git a/jnlib/logging.c b/jnlib/logging.c index 40b58aeb9..6267dc11c 100644 --- a/jnlib/logging.c +++ b/jnlib/logging.c @@ -39,6 +39,7 @@ #define JNLIB_NEED_LOG_LOGV 1 +#define JNLIB_NEED_AFLOCAL 1 #include "libjnlib-config.h" #include "logging.h" @@ -152,8 +153,7 @@ fun_writer (void *cookie_arg, const char *buffer, my_funopen_hook_size_t size) addr.sun_family = PF_LOCAL; strncpy (addr.sun_path, cookie->name, sizeof (addr.sun_path)-1); addr.sun_path[sizeof (addr.sun_path)-1] = 0; - addrlen = (offsetof (struct sockaddr_un, sun_path) - + strlen (addr.sun_path) + 1); + addrlen = SUN_LEN (&addr); if (connect (cookie->fd, (struct sockaddr *) &addr, addrlen) == -1) { -- cgit