summaryrefslogtreecommitdiff
path: root/lib/libevent
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-10-17 20:53:00 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-10-17 20:53:00 +0000
commit7d9fe7e5b97b35f455c1d17ad190e03167dad336 (patch)
treeea101bba0eb2ef5dbfc94cf76ebc42c710c5e81c /lib/libevent
parent90a963cdd06d956e0ed538055e8aac5a4269a0a5 (diff)
Remove some #ifdef HAVE_syscall.
OK nicm@
Diffstat (limited to 'lib/libevent')
-rw-r--r--lib/libevent/Makefile11
-rw-r--r--lib/libevent/event.c6
-rw-r--r--lib/libevent/evutil.c31
3 files changed, 3 insertions, 45 deletions
diff --git a/lib/libevent/Makefile b/lib/libevent/Makefile
index 500ff302c43..ceb7088a415 100644
--- a/lib/libevent/Makefile
+++ b/lib/libevent/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.35 2014/10/17 19:16:01 bluhm Exp $
+# $OpenBSD: Makefile,v 1.36 2014/10/17 20:52:59 bluhm Exp $
LIB= event
SRCS= buffer.c evbuffer.c event.c event_tagging.c evutil.c kqueue.c \
@@ -59,15 +59,7 @@ MLINKS= event.3 bufferevent_base_set.3 \
event.3 event_asr_abort.3
CFLAGS+= -I${.CURDIR} -DNDEBUG \
- -DHAVE_CLOCK_GETTIME \
- -DHAVE_CLOCK_MONOTONIC \
-DHAVE_FD_MASK \
- -DHAVE_GETADDRINFO \
- -DHAVE_GETEGID \
- -DHAVE_GETEUID \
- -DHAVE_GETNAMEINFO \
- -DHAVE_GETTIMEOFDAY \
- -DHAVE_ISSETUGID \
-DHAVE_POLL \
-DHAVE_SELECT \
-DHAVE_SETFD \
@@ -75,7 +67,6 @@ CFLAGS+= -I${.CURDIR} -DNDEBUG \
-DHAVE_STRSEP \
-DHAVE_STRTOK_R \
-DHAVE_STRTOLL \
- -DHAVE_STRUCT_IN6_ADDR \
-DHAVE_VASPRINTF \
-DHAVE_WORKING_KQUEUE
diff --git a/lib/libevent/event.c b/lib/libevent/event.c
index 3af73eaa3e4..0ad2bbc4733 100644
--- a/lib/libevent/event.c
+++ b/lib/libevent/event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.c,v 1.32 2014/10/17 19:16:01 bluhm Exp $ */
+/* $OpenBSD: event.c,v 1.33 2014/10/17 20:52:59 bluhm Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -113,12 +113,10 @@ static void timeout_correct(struct event_base *, struct timeval *);
static void
detect_monotonic(void)
{
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
use_monotonic = 1;
-#endif
}
static int
@@ -129,7 +127,6 @@ gettime(struct event_base *base, struct timeval *tp)
return (0);
}
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
if (use_monotonic) {
struct timespec ts;
@@ -140,7 +137,6 @@ gettime(struct event_base *base, struct timeval *tp)
tp->tv_usec = ts.tv_nsec / 1000;
return (0);
}
-#endif
return (evutil_gettimeofday(tp, NULL));
}
diff --git a/lib/libevent/evutil.c b/lib/libevent/evutil.c
index 7293ebcf633..131da2d459e 100644
--- a/lib/libevent/evutil.c
+++ b/lib/libevent/evutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evutil.c,v 1.6 2014/10/17 19:16:01 bluhm Exp $ */
+/* $OpenBSD: evutil.c,v 1.7 2014/10/17 20:52:59 bluhm Exp $ */
/*
* Copyright (c) 2007 Niels Provos <provos@citi.umich.edu>
@@ -77,22 +77,6 @@ evutil_strtoll(const char *s, char **endptr, int base)
#endif
}
-#ifndef HAVE_GETTIMEOFDAY
-int
-evutil_gettimeofday(struct timeval *tv, struct timezone *tz)
-{
- struct _timeb tb;
-
- if(tv == NULL)
- return -1;
-
- _ftime(&tb);
- tv->tv_sec = (long) tb.time;
- tv->tv_usec = ((int) tb.millitm) * 1000;
- return 0;
-}
-#endif
-
int
evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
{
@@ -124,20 +108,7 @@ evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
static int
evutil_issetugid(void)
{
-#ifdef HAVE_ISSETUGID
return issetugid();
-#else
-
-#ifdef HAVE_GETEUID
- if (getuid() != geteuid())
- return 1;
-#endif
-#ifdef HAVE_GETEGID
- if (getgid() != getegid())
- return 1;
-#endif
- return 0;
-#endif
}
const char *