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. --- common/simple-pwquery.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common/simple-pwquery.c') diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c index 3a1f0365f..3598b3598 100644 --- a/common/simple-pwquery.c +++ b/common/simple-pwquery.c @@ -39,6 +39,9 @@ #ifdef HAVE_LOCALE_H #include #endif + +#define JNLIB_NEED_AFLOCAL +#include "../jnlib/mischelp.h" #ifdef HAVE_W32_SYSTEM #include "../jnlib/w32-afunix.h" #endif @@ -379,8 +382,7 @@ agent_open (int *rfd) memset (&client_addr, 0, sizeof client_addr); client_addr.sun_family = AF_UNIX; strcpy (client_addr.sun_path, infostr); - len = (offsetof (struct sockaddr_un, sun_path) - + strlen(client_addr.sun_path) + 1); + len = SUN_LEN (&client_addr); #ifdef HAVE_W32_SYSTEM rc = _w32_sock_connect (fd, (struct sockaddr*)&client_addr, len ); -- cgit v1.2.3