Changeset 384 for trunk


Ignore:
Timestamp:
Dec 7, 2011, 9:23:01 PM (13 years ago)
Author:
katerina
Message:

Fix for ticket #282 (compile issues on FreeBSD).

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r383 r384  
    9797        ;;
    9898
     99        *freebsd8*|*freebsd9*)
     100        AC_DEFINE(HOST_IS_FREEBSD)
     101        selectconfig=freebsd
     102        case "$host_cpu" in
     103                amd64|x86_64)
     104                dnmalloc_ok=no
     105                AC_MSG_RESULT([no dnmalloc])
     106                ;;
     107                *)
     108                AC_MSG_RESULT([none])
     109                ;;
     110        esac
     111        ;;
     112       
    99113        *freebsd7*)
    100114        AC_DEFINE(HOST_IS_FREEBSD)
    101115        selectconfig=freebsd
    102116        case "$host_cpu" in
    103                 amd64)
     117                amd64|x86_64)
    104118                sh_use_pie=no
    105119                dnmalloc_ok=no
     
    330344                AC_HEADER_EGREP([struct acct_v3],   sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
    331345                                                                [Define if <sys/acct.h> has struct acct_v3.]))
     346                AC_HEADER_EGREP([struct acctv2],    sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
     347                                                                [Define if <sys/acct.h> has struct acctv2.]))
     348
    332349 )
    333350
  • trunk/docs/Changelog

    r382 r384  
    1111          wrong function call (OSX specific code), reported by S. Mirolo
    1212
    13 3.0.0a:
     133.0.0a (06-10-2011):
    1414        * Fix compile-time issues on RHEL5 (reported by Thomas)
    1515
    16 3.0.0 (01-10-2011):
     163.0.0 (01-11-2011):
    1717        * Add support for the inotify API
    1818        * If --disable-shellexpand is used, also disable setting
  • trunk/src/sh_log_parse_pacct.c

    r292 r384  
    225225}
    226226
    227 /* This looks strange, but it's real ANSI C. */
    228 extern struct acct pacct_rd_never_used;
    229 #define COMM_LEN ((int) sizeof (pacct_rd_never_used.ac_comm))
    230 
    231 sh_string * sh_read_pacct (sh_string * record, struct sh_logfile * logfile)
    232 {
    233227#if defined(__linux__) && defined(HAVE_ACCT_V3)
    234228#  define STRUCT_ACCT struct acct_v3
     229#elif defined(__FreeBSD__) && defined(HAVE_ACCTV2)
     230#  define STRUCT_ACCT struct acctv2
    235231#else
    236232#  define STRUCT_ACCT struct acct
    237233#endif
    238234
     235/* This looks strange, but it's real ANSI C. */
     236extern STRUCT_ACCT pacct_rd_never_used;
     237#define COMM_LEN ((int) sizeof (pacct_rd_never_used.ac_comm))
     238
     239sh_string * sh_read_pacct (sh_string * record, struct sh_logfile * logfile)
     240{
    239241  STRUCT_ACCT rec;
    240242
     
    249251      char   out[64+COMM_LEN+1+5+8+8+32+4+19+7]; /* see printf format below */
    250252     
    251       expand_flags(rec.ac_flag, fl);
     253#if defined(ac_flagx)
     254      expand_flags(rec.ac_flagx, fl);
     255#else
     256      expand_flags(rec.ac_flag,  fl);
     257#endif
    252258     
    253259      /* ac_comm may not be null terminated
  • trunk/src/sh_port2proc.c

    r315 r384  
    802802                                continue;
    803803                } else if (inp->inp_vflag & INP_IPV6) {
     804#ifndef in6p_fport
     805#define in6p_fport inp_fport
     806#endif
    804807                        if ((inp->in6p_fport == 0 && !opt_l) ||
    805808                            (inp->in6p_fport != 0 && !opt_c))
     
    822825                memset(sock, '\0', sizeof (*sock));
    823826
     827#ifndef in6p_lport
     828#define in6p_lport inp_lport
     829#endif
    824830                sock->socket = so->xso_so;
    825831                sock->proto = proto;
     
    917923  int n, hash;
    918924  struct xfile *xf;
    919   struct in_addr  * haddr;
    920   struct in6_addr * haddr6;
     925  struct in_addr  * haddr  = NULL;
     926  struct in6_addr * haddr6 = NULL;
    921927  struct sock * s;
    922928  struct in6_addr   anyaddr = IN6ADDR_ANY_INIT;
  • trunk/src/sh_processcheck.c

    r383 r384  
    2727#include "config_xor.h"
    2828
    29 #define _XOPEN_SOURCE 500
     29/* changed from 500 to 600 b/o FreeBSD (see sys/cdefs.h)
     30 * which needs _POSIX_C_SOURCE >= 200112 for lstat()
     31 */
     32#define _XOPEN_SOURCE 600
    3033
    3134#include <stdio.h>
     
    3437#include <string.h>
    3538#include <sys/types.h>
     39#include <sys/stat.h>
    3640#include <dirent.h>
    37 #include <sys/stat.h>
    3841#include <signal.h>
    3942#include <unistd.h>
Note: See TracChangeset for help on using the changeset viewer.