summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2006-11-29 17:46:10 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2006-11-29 17:46:10 +0000
commitb04e3e97159584f4cbebd08c2a0d33374c430dd6 (patch)
treef4ca3b9de2feb6ab5fda9be1b2aec6382149da60 /devel
parentwhile adding vpopmail-devel as a package, PKG_PREFIX (diff)
- Real fix to run in FreeBSD < 5.1. Use CLOCK_REALTIME when CLOCK_MONOTONIC does not exists.
Notes
Notes: svn path=/head/; revision=178269
Diffstat (limited to 'devel')
-rw-r--r--devel/libevent/files/patch-evdns.c17
-rw-r--r--devel/libevent/files/patch-event.c17
-rw-r--r--devel/libevent/files/patch-event.h16
3 files changed, 34 insertions, 16 deletions
diff --git a/devel/libevent/files/patch-evdns.c b/devel/libevent/files/patch-evdns.c
new file mode 100644
index 000000000000..d41d574b6cb1
--- /dev/null
+++ b/devel/libevent/files/patch-evdns.c
@@ -0,0 +1,17 @@
+#
+# Use CLOCK_REALTIME when CLOCK_MONOTONIC does not exists.
+#
+--- evdns.c.orig Wed Nov 29 15:37:46 2006
++++ evdns.c Wed Nov 29 15:39:14 2006
+@@ -793,7 +793,11 @@
+ #ifdef DNS_USE_CPU_CLOCK_FOR_ID
+ struct timespec ts;
+ const u16 trans_id = ts.tv_nsec & 0xffff;
++#ifdef CLOCK_MONOTONIC
+ if (clock_gettime(CLOCK_MONOTONIC, &ts))
++#else
++ if (clock_gettime(CLOCK_REALTIME, &ts))
++#endif
+ event_err(1, "clock_gettime");
+ #endif
+
diff --git a/devel/libevent/files/patch-event.c b/devel/libevent/files/patch-event.c
new file mode 100644
index 000000000000..aa126519dbda
--- /dev/null
+++ b/devel/libevent/files/patch-event.c
@@ -0,0 +1,17 @@
+#
+# Use CLOCK_REALTIME when CLOCK_MONOTONIC does not exists.
+#
+--- event.c.orig Wed Nov 29 15:37:37 2006
++++ event.c Wed Nov 29 15:38:39 2006
+@@ -150,7 +150,11 @@
+ #ifdef HAVE_CLOCK_GETTIME
+ struct timespec ts;
+
++#ifdef CLOCK_MONOTONIC
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
++#else
++ if (clock_gettime(CLOCK_REALTIME, &ts) == -1)
++#endif
+ return (-1);
+ tp->tv_sec = ts.tv_sec;
+ tp->tv_usec = ts.tv_nsec / 1000;
diff --git a/devel/libevent/files/patch-event.h b/devel/libevent/files/patch-event.h
deleted file mode 100644
index 65232cbfa5bb..000000000000
--- a/devel/libevent/files/patch-event.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Define CLOCK_MONOTONIC if FreeBSD < 5.1
-#
---- event.h.orig Wed Nov 29 12:09:48 2006
-+++ event.h Wed Nov 29 12:10:25 2006
-@@ -56,6 +56,10 @@
- #define EV_SIGNAL 0x08
- #define EV_PERSIST 0x10 /* Persistant event */
-
-+#if defined(__FreeBSD__) && (__FreeBSD_version < 501000)
-+#define CLOCK_MONOTONIC 4
-+#endif
-+
- /* Fix so that ppl dont have to run with <sys/queue.h> */
- #ifndef TAILQ_ENTRY
- #define _EVENT_DEFINED_TQENTRY