1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Fix possible system freeze on Mac OS X.

This commit is contained in:
Werner Koch 2009-05-19 22:39:45 +00:00
parent 98f10d74b8
commit 4fa261f8ec
14 changed files with 73 additions and 28 deletions

View file

@ -1,3 +1,8 @@
2009-05-19 Werner Koch <wk@g10code.com>
* watchgnupg.c: Include jnlib/mischelp.h if required.
(main): Use SUN_LEN.
2009-04-17 Werner Koch <wk@g10code.com>
* ccidmon.c: New.

View file

@ -86,7 +86,6 @@ create_server_socket (const char *filename, int *new_sock)
name.sun_family = AF_LOCAL;
strncpy (name.sun_path, filename, sizeof (name.sun_path));
name.sun_path[sizeof (name.sun_path) - 1] = '\0';
size = SUN_LEN (&name);
remove (filename);

View file

@ -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 <bug-gnupg@gnu.org>.\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: