aboutsummaryrefslogtreecommitdiff
path: root/sysutils/heartbeat
diff options
context:
space:
mode:
authorOlli Hauer <ohauer@FreeBSD.org>2011-09-20 21:40:51 +0000
committerOlli Hauer <ohauer@FreeBSD.org>2011-09-20 21:40:51 +0000
commit102610b73e88fca194913fb10e4ea8c325c850d6 (patch)
treef327baf6a4b368cc5d2ffac539a67bd1b70030d4 /sysutils/heartbeat
parenta99d027f2a5091aac9a641a2e3e41d306e0310fa (diff)
downloadports-102610b73e88fca194913fb10e4ea8c325c850d6.tar.gz
ports-102610b73e88fca194913fb10e4ea8c325c850d6.zip
Notes
Diffstat (limited to 'sysutils/heartbeat')
-rw-r--r--sysutils/heartbeat/Makefile2
-rw-r--r--sysutils/heartbeat/files/patch-configure.in21
-rw-r--r--sysutils/heartbeat/files/patch-include-clplumbing-longclock.h20
-rw-r--r--sysutils/heartbeat/files/patch-lib-clplumbping-longclock.c79
4 files changed, 119 insertions, 3 deletions
diff --git a/sysutils/heartbeat/Makefile b/sysutils/heartbeat/Makefile
index b2e0da168581..a6036f925c62 100644
--- a/sysutils/heartbeat/Makefile
+++ b/sysutils/heartbeat/Makefile
@@ -7,7 +7,7 @@
PORTNAME= heartbeat
PORTVERSION= 2.1.4
-PORTREVISION= 14
+PORTREVISION= 15
CATEGORIES= sysutils
#MASTER_SITES= http://hg.linux-ha.org/lha-2.1/archive/STABLE-2.1.4.tar.bz2
MASTER_SITES= ${MASTER_SITE_LOCAL}
diff --git a/sysutils/heartbeat/files/patch-configure.in b/sysutils/heartbeat/files/patch-configure.in
index 3f94f6132890..fc04d35d4b5a 100644
--- a/sysutils/heartbeat/files/patch-configure.in
+++ b/sysutils/heartbeat/files/patch-configure.in
@@ -1,5 +1,5 @@
--- configure.in.orig 2008-08-18 07:32:19.000000000 -0500
-+++ configure.in 2008-10-11 22:56:48.000000000 -0500
++++ configure.in 2011-09-07 16:36:38.000000000 -0500
@@ -65,6 +65,13 @@
pf_argv_set=""
@@ -65,7 +65,24 @@
else
LIBNETDEFINES="`$LIBNETCONFIG --defines` `$LIBNETCONFIG --cflags`";
LIBNETLIBS="`$LIBNETCONFIG --libs`";
-@@ -2393,13 +2401,13 @@
+@@ -1718,6 +1726,7 @@
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)
++AC_CHECK_SIZEOF(clock_t, [], [#include <sys/times.h>])
+
+ AC_ARG_ENABLE([all],
+ [ --enable-all Activate ALL features
+@@ -2381,7 +2390,7 @@
+
+
+ AC_MSG_CHECKING(if clock_t is long enough)
+-if test $ac_cv_sizeof_long -ge 8; then
++if test $ac_cv_sizeof_clock_t -ge 8; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(CLOCK_T_IS_LONG_ENOUGH, 1, [Set if CLOCK_T is adequate by itself for the "indefinite future" (>= 100 years)])
+ else
+@@ -2393,13 +2402,13 @@
dnl Note: reduce LIBS; in particular, ltdl can cause confusion.
dnl Possibly better: move 'LIBS="$LIBS -lltdl"' from above to beyond here.
dnl
diff --git a/sysutils/heartbeat/files/patch-include-clplumbing-longclock.h b/sysutils/heartbeat/files/patch-include-clplumbing-longclock.h
new file mode 100644
index 000000000000..5991f679a64f
--- /dev/null
+++ b/sysutils/heartbeat/files/patch-include-clplumbing-longclock.h
@@ -0,0 +1,20 @@
+--- include/clplumbing/longclock.h.orig 2008-08-18 07:32:19.000000000 -0500
++++ include/clplumbing/longclock.h 2011-09-07 16:43:50.000000000 -0500
+@@ -37,7 +37,7 @@
+ *
+ * The functions provided here are:
+ *
+- * unsigned long cl_times(void);
++ * clock_t cl_times(void);
+ * A rational wrapper for the times(2) call
+ * for those cases where only the return value
+ * is wanted.
+@@ -79,7 +79,7 @@
+ *
+ * extern const longclock_t zero_longclock;
+ */
+-extern unsigned long cl_times(void);
++extern clock_t cl_times(void);
+
+ #ifdef CLOCK_T_IS_LONG_ENOUGH
+ # ifndef HAVE_LONGCLOCK_ARITHMETIC
diff --git a/sysutils/heartbeat/files/patch-lib-clplumbping-longclock.c b/sysutils/heartbeat/files/patch-lib-clplumbping-longclock.c
new file mode 100644
index 000000000000..f2667078c1c1
--- /dev/null
+++ b/sysutils/heartbeat/files/patch-lib-clplumbping-longclock.c
@@ -0,0 +1,79 @@
+--- lib/clplumbing/longclock.c.orig 2008-08-18 07:32:19.000000000 -0500
++++ lib/clplumbing/longclock.c 2011-09-07 17:52:32.000000000 -0500
+@@ -68,7 +68,7 @@
+ # define TIMES_PARAM &dummy_longclock_tms_struct
+ #endif
+
+-unsigned long
++clock_t
+ cl_times(void) /* Make times(2) behave rationally on Linux */
+ {
+ clock_t ret;
+@@ -108,7 +108,7 @@
+ }
+ errno = save_errno;
+ #endif /* DISABLE_TIMES_KLUDGE */
+- return (unsigned long)ret;
++ return ret;
+ }
+
+ #ifdef CLOCK_T_IS_LONG_ENOUGH
+@@ -124,8 +124,9 @@
+
+ #define BITSPERBYTE 8
+ #define WRAPSHIFT (BITSPERBYTE*sizeof(clock_t))
+-#define MAXIMUMULONG ((unsigned long)~(0UL))
+-#define MINJUMP ((MAXIMUMULONG/100UL)*99UL)
++#define WRAPAMOUNT (((longclock_t) 1) << WRAPSHIFT)
++#define MAXIMUMCLOCK (WRAPAMOUNT - 1)
++#define MINJUMP ((MAXIMUMCLOCK/100UL)*99UL)
+
+ longclock_t
+ time_longclock(void)
+@@ -136,20 +137,20 @@
+ * because then this can recurse infinitely; that is why the
+ * cl_log call is where it is; found by Simon Graham. */
+ static gboolean calledbefore = FALSE;
+- static unsigned long lasttimes = 0L;
+- static unsigned long wrapcount = 0L;
++ static longclock_t lasttimes = 0L;
++ static longclock_t wrapcount = 0L;
+ static unsigned long callcount = 0L;
+- static longclock_t lc_wrapcount = 0L;
+- unsigned long timesval;
++
++ longclock_t timesval;
+
+ ++callcount;
+
+- timesval = (unsigned long) cl_times();
++ timesval = ((longclock_t) cl_times()) & MAXIMUMCLOCK; /* this AND prevents sign extension */
+
+ if (calledbefore && timesval < lasttimes) {
+- clock_t jumpbackby = lasttimes - timesval;
++ longclock_t jumpbackby = lasttimes - timesval;
+
+- if (jumpbackby < (clock_t)MINJUMP) {
++ if (jumpbackby < MINJUMP) {
+ /* Kernel weirdness */
+ cl_log(LOG_CRIT
+ , "%s: clock_t from times(2) appears to"
+@@ -172,8 +173,7 @@
+ to double update of wrapcount! */
+
+ lasttimes = timesval;
+- ++wrapcount;
+- lc_wrapcount = ((longclock_t)wrapcount) << WRAPSHIFT;
++ wrapcount += WRAPAMOUNT;
+
+ cl_log(LOG_INFO
+ , "%s: clock_t wrapped around (uptime)."
+@@ -184,7 +184,7 @@
+ lasttimes = timesval;
+ calledbefore = TRUE;
+ }
+- return (lc_wrapcount | (longclock_t)timesval);
++ return (wrapcount | timesval);
+ }
+ #endif /* ! CLOCK_T_IS_LONG_ENOUGH */
+