fix for tls.c

Kenichi Okada okada at opaopa.org
Mon Jun 5 12:47:26 UTC 2000


This patch fixes tls.c for IRIX-6.2(and etc),
which needs to include alloca.h.

#include <alloca.h>

-- 
Kenichi Okada
mailto:okada at opaopa.org

*** tls.c-orig	Sun Jun  4 15:41:18 2000
--- tls.c	Sun Jun  4 16:13:40 2000
***************
*** 45,50 ****
--- 45,82 ----
  #include <syslog.h>
  #include <sys/uio.h>
  
+ /* taken from lib/parsedate.c */
+ #ifndef WRITEV_USE_ALLOCA
+ #ifdef alloca
+ #define WRITEV_USE_ALLOCA
+ #else /* alloca not defined */
+ #ifdef __GNUC__
+ #define WRITEV_USE_ALLOCA
+ #define alloca __builtin_alloca
+ #else /* not GNU C.  */
+ #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+ #define WRITEV_USE_ALLOCA
+ #include <alloca.h>
+ #else /* not sparc */
+ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+ #else /* not MSDOS, or __TURBOC__ */
+ #if defined(_AIX)
+  #pragma alloca
+ #define WRITEV_USE_ALLOCA
+ #endif /* not _AIX */
+ #endif /* not MSDOS, or __TURBOC__ */
+ #endif /* not sparc */
+ #endif /* not GNU C */
+ #endif /* alloca not defined */
+ #endif /* WRITEV_USE_ALLOCA not defined */
+ #ifdef WRITEV_USE_ALLOCA
+ #define WRITEV_ALLOC alloca
+ #else
+ #define WRITEV_ALLOC malloc
+ #endif
+ 
+ 
+ 
  /* OpenSSL library. */
  
  #include <openssl/lhash.h>
***************
*** 585,591 ****
    for (i = 0; i < count; ++i)
      bytes += vector[i].iov_len;
    /* Allocate a temporary buffer to hold the data.  */
!   buffer = (char *) alloca (bytes);
    /* Copy the data into BUFFER.  */
    to_copy = bytes;
    bp = buffer;
--- 617,623 ----
    for (i = 0; i < count; ++i)
      bytes += vector[i].iov_len;
    /* Allocate a temporary buffer to hold the data.  */
!   buffer = (char *) WRITEV_ALLOC (bytes);
    /* Copy the data into BUFFER.  */
    to_copy = bytes;
    bp = buffer;



More information about the inn-workers mailing list