Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. commit 0e4f7a12d14eb93fa33ea03b18582422f469266b
  2. Author: Greg Hudson <ghudson@mit.edu>
  3. Date: Wed Aug 23 17:45:02 2017 -0400
  4.  
  5. Fix AIX build issues
  6.  
  7. In k5-platform.h, only test for SHARED and define the finalizer as
  8. static if we don't expect linker options to be used for finalizers.
  9. SHARED is not a robust test (it isn't defined when building objects
  10. for shared libraries on AIX, OSF/1, or sometimes IRIX because they
  11. don't use separate PIC objects), and as linker finalizer options are
  12. only applied when shared libraries are created, we don't have to worry
  13. about finalizers happening for static libraries.
  14.  
  15. In expand_path.c, remove the unnecessary structure tag from "struct
  16. token" as it conflicts with <net/if_arp.h> on AIX.
  17.  
  18. In localaddr.c, initialize output parameters at the beginning of
  19. get_ifreq_array(). Otherwise, gcc cannot be sure that they are always
  20. set when get_ifreq_array() returns 0, because we use errno as a return
  21. value in one case. Also remove two unused variables.
  22.  
  23. Based on patches from Tony Reix.
  24.  
  25. ticket: 8608 (new)
  26.  
  27. diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h
  28. index d58710b..548c048 100644
  29. --- a/src/include/k5-platform.h
  30. +++ b/src/include/k5-platform.h
  31. @@ -361,16 +361,7 @@ typedef struct { int error; unsigned char did_run; } k5_init_t;
  32.  
  33.  
  34.  
  35. -#if !defined(SHARED) && !defined(_WIN32)
  36. -
  37. -/*
  38. - * In this case, we just don't care about finalization. The code will still
  39. - * define the function, but we won't do anything with it.
  40. - */
  41. -# define MAKE_FINI_FUNCTION(NAME) \
  42. - static void NAME(void) UNUSED
  43. -
  44. -#elif defined(USE_LINKER_FINI_OPTION) || defined(_WIN32)
  45. +#if defined(USE_LINKER_FINI_OPTION) || defined(_WIN32)
  46. /* If we're told the linker option will be used, it doesn't really
  47. matter what compiler we're using. Do it the same way
  48. regardless. */
  49. @@ -404,6 +395,15 @@ typedef struct { int error; unsigned char did_run; } k5_init_t;
  50.  
  51. # endif
  52.  
  53. +#elif !defined(SHARED)
  54. +
  55. +/*
  56. + * In this case, we just don't care about finalization. The code will still
  57. + * define the function, but we won't do anything with it.
  58. + */
  59. +# define MAKE_FINI_FUNCTION(NAME) \
  60. + static void NAME(void) UNUSED
  61. +
  62. #elif defined(__GNUC__) && defined(DESTRUCTOR_ATTR_WORKS)
  63. /* If we're using gcc, if the C++ support works, the compiler should
  64. build executables and shared libraries that support the use of
  65. diff --git a/src/lib/krb5/os/expand_path.c b/src/lib/krb5/os/expand_path.c
  66. index a8a14f4..61fb234 100644
  67. --- a/src/lib/krb5/os/expand_path.c
  68. +++ b/src/lib/krb5/os/expand_path.c
  69. @@ -351,7 +351,7 @@ expand_null(krb5_context context, PTYPE param, const char *postfix, char **ret)
  70. return 0;
  71. }
  72.  
  73. -static const struct token {
  74. +static const struct {
  75. const char *tok;
  76. PTYPE param;
  77. const char *postfix;
  78. diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c
  79. index 21bc719..58443f6 100644
  80. --- a/src/lib/krb5/os/localaddr.c
  81. +++ b/src/lib/krb5/os/localaddr.c
  82. @@ -862,6 +862,9 @@ get_ifreq_array(char **bufp, size_t *np, int s)
  83. int numifs = -1;
  84. #endif
  85.  
  86. + *bufp = NULL;
  87. + *np = 0;
  88. +
  89. /* At least on NetBSD, an ifreq can hold an IPv4 address, but
  90. isn't big enough for an IPv6 or ethernet address. So add a
  91. little more space. */
  92. @@ -938,9 +941,9 @@ foreach_localaddr (/*@null@*/ void *data,
  93. #endif
  94. {
  95. struct ifreq *ifr, ifreq, *ifr2;
  96. - int s, code;
  97. + int s;
  98. char *buf = 0;
  99. - size_t size, n, i, j;
  100. + size_t n, i, j;
  101. int retval = 0;
  102. #ifdef LINUX_IPV6_HACK
  103. struct linux_ipv6_addr_list *linux_ipv6_addrs = get_linux_ipv6_addrs ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement