aboutsummaryrefslogtreecommitdiffstats
path: root/tools/watchgnupg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-05-19 22:39:45 +0000
committerWerner Koch <[email protected]>2009-05-19 22:39:45 +0000
commit4fa261f8ecb16fabb4d06403f6ffacaa010ce453 (patch)
treef2786955474b37c97172d5dbf932e17bc48a2543 /tools/watchgnupg.c
parentRemove testing cruft. (diff)
downloadgnupg-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.tar.gz
gnupg-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.zip
Fix possible system freeze on Mac OS X.
Diffstat (limited to 'tools/watchgnupg.c')
-rw-r--r--tools/watchgnupg.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/tools/watchgnupg.c b/tools/watchgnupg.c
index 213a2cb16..145a76b5e 100644
--- a/tools/watchgnupg.c
+++ b/tools/watchgnupg.c
@@ -35,7 +35,7 @@
#define PGM "watchgnupg"
-/* Allow for a standalone build. */
+/* Allow for a standalone build on most systems. */
#ifdef VERSION
#define MYVERSION_LINE PGM " (GnuPG) " VERSION
#define BUGREPORT_LINE "\nReport bugs to <[email protected]>.\n"
@@ -43,16 +43,9 @@
#define MYVERSION_LINE PGM
#define BUGREPORT_LINE ""
#endif
-
-#ifndef PF_LOCAL
-# ifdef PF_UNIX
-# define PF_LOCAL PF_UNIX
-# else
-# define PF_LOCAL AF_UNIX
-# endif
-# ifndef AF_LOCAL
-# define AF_LOCAL AF_UNIX
-# endif
+#if !defined(SUN_LEN) || !defined(PF_LOCAL) || !defined(AF_LOCAL)
+#define JNLIB_NEED_AFLOCAL
+#include "../jnlib/mischelp.h"
#endif
@@ -285,8 +278,7 @@ main (int argc, char **argv)
srvr_addr.sun_family = AF_LOCAL;
strncpy (srvr_addr.sun_path, *argv, sizeof (srvr_addr.sun_path) - 1);
srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0;
- addrlen = (offsetof (struct sockaddr_un, sun_path)
- + strlen (srvr_addr.sun_path) + 1);
+ addrlen = SUN_LEN (&srvr_addr);
again: