From ae3e3e9cb1584b5cf7082c1b28c4cbbd48b1f664 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 6 Mar 2008 17:39:09 +0000 Subject: some minor things in regard to portability --- net.c | 8 +------- plugins/imklog/imklog.c | 14 ++++++++++---- rsyslog.h | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/net.c b/net.c index f7769f13..b7be521a 100644 --- a/net.c +++ b/net.c @@ -729,13 +729,7 @@ void debugListenInfo(int fd, char *type) struct sockaddr sa; struct sockaddr_in *ipv4; struct sockaddr_in6 *ipv6; -/* TODO: do this below better -- autotools? */ -#if defined(__hpux) -# define SOCKLEN_T int -#else -# define SOCKLEN_T socklen_t -#endif - SOCKLEN_T saLen = sizeof(sa); + socklen_t saLen = sizeof(sa); if(getsockname(fd, &sa, &saLen) == 0) { switch(sa.sa_family) { diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index 46c78e70..2731e08d 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -67,15 +67,19 @@ static int console_log_level = -1; #include #include #include -#if !defined(__GLIBC__) -#include -#endif /* __GLIBC__ */ + +#if HAVE_TIME_H +# include +#endif + #include #include #include "ksyms.h" #define __LIBRARY__ -#include +#include + + #if !defined(__GLIBC__) # define __NR_ksyslog __NR_syslog _syscall3(int,ksyslog,int, type, char *, buf, int, len); @@ -84,6 +88,8 @@ _syscall3(int,ksyslog,int, type, char *, buf, int, len); #define ksyslog klogctl #endif + + #ifndef _PATH_KLOG #define _PATH_KLOG "/proc/kmsg" #endif diff --git a/rsyslog.h b/rsyslog.h index 52a56972..de97e1b8 100644 --- a/rsyslog.h +++ b/rsyslog.h @@ -51,6 +51,7 @@ typedef int64 number_t; /* type to use for numbers - TODO: maybe an autoconf opt #ifdef __hpux typedef unsigned int u_int32_t; /* TODO: is this correct? */ +typedef int socklen_t; #endif /* The error codes below are orginally "borrowed" from -- cgit v1.2.3