summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-06-11 08:29:27 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-06-11 08:29:27 +0000
commit81378442ff2a89b20595ee52a25b21383df7bf9d (patch)
treef4484d4b8ad290fbd52fb38992d8cdf7339089cf
parent81ae51f0393e75b0e65c9b1e84d399e54f2dd7c4 (diff)
downloadrsyslog-81378442ff2a89b20595ee52a25b21383df7bf9d.tar.gz
rsyslog-81378442ff2a89b20595ee52a25b21383df7bf9d.tar.xz
rsyslog-81378442ff2a89b20595ee52a25b21383df7bf9d.zip
changes to make klogd integration compile under freebsd
-rw-r--r--freebsd/Makefile7
-rw-r--r--klogd.c8
-rw-r--r--ksym.c3
-rw-r--r--ksym_mod.c3
4 files changed, 19 insertions, 2 deletions
diff --git a/freebsd/Makefile b/freebsd/Makefile
index 7b05766f..2170544f 100644
--- a/freebsd/Makefile
+++ b/freebsd/Makefile
@@ -39,6 +39,9 @@ FEATURE_PTHREADS=1
# results in moderate savings of network traffic.
FEATURE_NETZIP=1
+# For Freebsd, we disable klogd
+FEATURE_KLOGD=0
+
# Enable debug mode (much slower code)
FEATURE_DEBUG=0
@@ -71,6 +74,10 @@ MANDIR = /usr/share/man
WITHDB=-DWITH_DB
.endif
+.if $(FEATURE_KLOGD) == 1
+ WITHDB=-DWITH_KLOGD
+.endif
+
.if $(FEATURE_NETZIP) == 1
NETZIP=-DWITH_DB
.endif
diff --git a/klogd.c b/klogd.c
index 9dfa8b14..a7087e4c 100644
--- a/klogd.c
+++ b/klogd.c
@@ -19,6 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifdef WITH_KLOGD
/*
* Steve Lord (lord@cray.com) 7th Nov 92
*
@@ -1169,6 +1170,13 @@ int main(argc, argv)
}
}
}
+#else /* #ifdef WITH_KLOGD */
+#include <stdio.h>
+void main()
+{
+ fprintf(stderr, "FEATURE_KLOGD was disabled during this build, so klogd is not available.\n");
+}
+#endif /* #ifdef WITH_KLOGD */
/*
* Local variables:
* c-indent-level: 8
diff --git a/ksym.c b/ksym.c
index f3d4f868..feb45f63 100644
--- a/ksym.c
+++ b/ksym.c
@@ -1,3 +1,4 @@
+#ifdef FEATURE_KLOGD
/*
ksym.c - functions for kernel address->symbol translation
Copyright (c) 1995, 1996 Dr. G.W. Wettstein <greg@wind.rmcc.com>
@@ -110,7 +111,6 @@
/* Includes. */
#include <stdlib.h>
-#include <malloc.h>
#include <sys/utsname.h>
#include <ctype.h>
#include "klogd.h"
@@ -980,3 +980,4 @@ extern void Syslog(int priority, char *fmt, ...)
return;
}
#endif
+#endif /* #ifdef FEATURE_KLOGD */
diff --git a/ksym_mod.c b/ksym_mod.c
index d61250f2..12f2c010 100644
--- a/ksym_mod.c
+++ b/ksym_mod.c
@@ -1,3 +1,4 @@
+#ifdef FEATURE_KLOGD
/*
ksym_mod.c - functions for building symbol lookup tables for klogd
Copyright (c) 1995, 1996 Dr. G.W. Wettstein <greg@wind.rmcc.com>
@@ -83,7 +84,6 @@
/* Includes. */
#include <stdlib.h>
-#include <malloc.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
@@ -698,3 +698,4 @@ extern void Syslog(int priority, char *fmt, ...)
}
#endif
+#endif /* #ifdef FEATURE_KLOGD */