diff options
author | Werner Koch <[email protected]> | 2009-05-19 22:39:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2009-05-19 22:39:45 +0000 |
commit | 4fa261f8ecb16fabb4d06403f6ffacaa010ce453 (patch) | |
tree | f2786955474b37c97172d5dbf932e17bc48a2543 /scd | |
parent | Remove testing cruft. (diff) | |
download | gnupg-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.tar.gz gnupg-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.zip |
Fix possible system freeze on Mac OS X.
Diffstat (limited to 'scd')
-rw-r--r-- | scd/ChangeLog | 5 | ||||
-rw-r--r-- | scd/scdaemon.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index a6fa9eb55..e81544a5b 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,8 @@ +2009-05-19 Werner Koch <[email protected]> + + * scdaemon.c (create_server_socket): Use SUN_LEN. + (JNLIB_NEED_AFLOCAL): Define. + 2009-05-13 Werner Koch <[email protected]> * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers. diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 0afb5febc..49f09cf62 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -38,6 +38,7 @@ #include <pth.h> #define JNLIB_NEED_LOG_LOGV +#define JNLIB_NEED_AFLOCAL #include "scdaemon.h" #include <ksba.h> #include <gcrypt.h> @@ -1032,8 +1033,7 @@ create_server_socket (int is_standard_name, const char *name, serv_addr->sun_family = AF_UNIX; assert (strlen (name) + 1 < sizeof (serv_addr->sun_path)); strcpy (serv_addr->sun_path, name); - len = (offsetof (struct sockaddr_un, sun_path) - + strlen (serv_addr->sun_path) + 1); + len = SUN_LEN (serv_addr); rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len); if (is_standard_name && rc == -1 && errno == EADDRINUSE) |