~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-security

« back to all changes in this revision

Viewing changes to jnlib/mischelp.h

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-08-04 12:27:49 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090804122749-q0j52zp6xmzvyall
Tags: 2.0.12-0ubuntu1
* New upstream release.
* Add 01-scd-pw2.patch, 03-opgp-writekey.patch, and 06-opgp-sign3072.patch
  from https://bugs.g10code.com/gnupg/issue1094 to make OpenPGP 2.0
  smartcards work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* mischelp.h - Miscellaneous helper macros and functions
2
2
 * Copyright (C) 1999, 2000, 2001, 2002, 2003,
3
 
 *               2006, 2007  Free Software Foundation, Inc.
 
3
 *               2006, 2007, 2009  Free Software Foundation, Inc.
4
4
 *
5
5
 * This file is part of JNLIB.
6
6
 *
60
60
#define wipememory(_ptr,_len) wipememory2(_ptr,0,_len)
61
61
 
62
62
 
 
63
/* Include hacks which are mainly required for Slowaris.  */
 
64
#ifdef JNLIB_NEED_AFLOCAL
 
65
#ifndef HAVE_W32_SYSTEM
 
66
# include <sys/socket.h>
 
67
# include <sys/un.h>
 
68
#else
 
69
# include <windows.h>
 
70
#endif
 
71
 
 
72
#ifndef PF_LOCAL
 
73
# ifdef PF_UNIX
 
74
#  define PF_LOCAL PF_UNIX
 
75
# else
 
76
#  define PF_LOCAL AF_UNIX
 
77
# endif
 
78
#endif /*PF_LOCAL*/
 
79
#ifndef AF_LOCAL
 
80
# define AF_LOCAL AF_UNIX
 
81
#endif /*AF_UNIX*/
 
82
 
 
83
/* We used to avoid this macro in GnuPG and inlined the AF_LOCAL name
 
84
   length computation directly with the little twist of adding 1 extra
 
85
   byte.  It seems that this was needed once on an old HP/UX box and
 
86
   there are also rumours that 4.3 Reno and DEC systems need it.  This
 
87
   one-off buglet did not harm any current system until it came to Mac
 
88
   OS X where the kernel (as of May 2009) exhibited a strange bug: The
 
89
   systems basically froze in the connect call if the passed name
 
90
   contained an invalid directory part.  Ignore the old Unices.  */
 
91
#ifndef SUN_LEN
 
92
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
 
93
                       + strlen ((ptr)->sun_path))
 
94
#endif /*SUN_LEN*/
 
95
#endif /*JNLIB_NEED_AFLOCAL*/
 
96
 
63
97
 
64
98
#endif /*LIBJNLIB_MISCHELP_H*/