Changeset 384 for trunk/src


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/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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.