summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-05-26 17:50:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-05-26 17:50:01 +0000
commitefc79750f5fe3949140bd02f9564ab8bbd852202 (patch)
tree1cfd3e49ea450345d7ca47c55e0408777c6db1be
parentaabdeff746be7e6d222817443022757198dada74 (diff)
libevent has named two of it's new macros by the same name as our kernel
macros, which are visible, and get pulled into some source code... Hide the kernel ones inside _KERNEL, and make trpt (the only userland viewer of them) define _KERNEL temporarily. This is really gross. libevent is doing a poor job of choosing function names! ok tedu guenther
-rw-r--r--sys/sys/timeout.h4
-rw-r--r--usr.sbin/trpt/trpt.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/sys/timeout.h b/sys/sys/timeout.h
index b0d4d4ad3cc..87ac0847615 100644
--- a/sys/sys/timeout.h
+++ b/sys/sys/timeout.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: timeout.h,v 1.19 2009/06/02 22:05:54 guenther Exp $ */
+/* $OpenBSD: timeout.h,v 1.20 2010/05/26 17:50:00 deraadt Exp $ */
/*
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -71,6 +71,7 @@ struct timeout {
#define TIMEOUT_INITIALIZED 4 /* timeout is initialized */
#define TIMEOUT_TRIGGERED 8 /* timeout is running or ran */
+#ifdef _KERNEL
/*
* special macros
*
@@ -81,7 +82,6 @@ struct timeout {
#define timeout_initialized(to) ((to)->to_flags & TIMEOUT_INITIALIZED)
#define timeout_triggered(to) ((to)->to_flags & TIMEOUT_TRIGGERED)
-#ifdef _KERNEL
void timeout_set(struct timeout *, void (*)(void *), void *);
void timeout_add(struct timeout *, int);
void timeout_add_tv(struct timeout *, const struct timeval *);
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index f7aece1b50a..4f9280ec146 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trpt.c,v 1.25 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: trpt.c,v 1.26 2010/05/26 17:49:57 deraadt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -65,6 +65,9 @@
#include <sys/socketvar.h>
#define PRUREQUESTS
#include <sys/protosw.h>
+#define _KERNEL
+#include <sys/timeout.h> /* to get timeout_pending() and such */
+#undef _KERNEL
#include <sys/file.h>
#include <net/route.h>