diff options
author | Werner Koch <wk@gnupg.org> | 2010-08-06 15:52:01 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-08-06 15:52:01 +0200 |
commit | dc5a80930b2c18011a40f1d929119c2545cc1124 (patch) | |
tree | a74bce4e2b437331578c2ab9f1568dcecc2acf21 /dirmngr/dirmngr.c | |
parent | Simplified http.c. (diff) | |
download | gnupg2-dc5a80930b2c18011a40f1d929119c2545cc1124.tar.xz gnupg2-dc5a80930b2c18011a40f1d929119c2545cc1124.zip |
More work on the dirmngr. It now builds for W32 and W32CE and quick
tests show that it works on W32.
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r-- | dirmngr/dirmngr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 52efb9be4..7aafc48ce 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -44,6 +44,7 @@ #define JNLIB_NEED_LOG_LOGV +#define JNLIB_NEED_AFLOCAL #include "dirmngr.h" #include <assuan.h> @@ -963,12 +964,17 @@ main (int argc, char **argv) memset (&serv_addr, 0, sizeof serv_addr); serv_addr.sun_family = AF_UNIX; strcpy (serv_addr.sun_path, socket_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 (rc == -1 && errno == EADDRINUSE) + if (rc == -1 + && (errno == EADDRINUSE +#ifdef HAVE_W32_SYSTEM + || errno == EEXIST +#endif + )) { + /* Fixme: We should test whether a dirmngr is already running. */ gnupg_remove (socket_name); rc = assuan_sock_bind (fd, (struct sockaddr*) &serv_addr, len); } |