diff options
author | he <he@pkgsrc.org> | 2014-12-09 10:45:51 +0000 |
---|---|---|
committer | he <he@pkgsrc.org> | 2014-12-09 10:45:51 +0000 |
commit | 8782c3b8bc7791b38316df96d64537a0edcfe3bd (patch) | |
tree | cef3d8e62b92e8224e8151123ec3448a2fd50bab /mbone | |
parent | 359a5efed56a263b1bd8e673b1ea9c9c15ef244a (diff) | |
download | pkgsrc-8782c3b8bc7791b38316df96d64537a0edcfe3bd.tar.gz |
It can happen that times() returns ((uint32_t)-1). If that happens,
retry a limited number of times, and log the events. Export log() from
the main program for use in dbeacon_posix.cpp.
Fix the matrix.pl script since qw() no longer acts as parenteses, so add
some of our own where called for.
Bump PKGREVISION.
Diffstat (limited to 'mbone')
-rw-r--r-- | mbone/dbeacon/Makefile | 6 | ||||
-rw-r--r-- | mbone/dbeacon/distinfo | 8 | ||||
-rw-r--r-- | mbone/dbeacon/patches/patch-contrib_matrix.pl | 35 | ||||
-rw-r--r-- | mbone/dbeacon/patches/patch-dbeacon.cpp | 12 | ||||
-rw-r--r-- | mbone/dbeacon/patches/patch-dbeacon.h | 14 | ||||
-rw-r--r-- | mbone/dbeacon/patches/patch-dbeacon__posix.cpp | 38 |
6 files changed, 97 insertions, 16 deletions
diff --git a/mbone/dbeacon/Makefile b/mbone/dbeacon/Makefile index 94fe8741a29..1c054c7406f 100644 --- a/mbone/dbeacon/Makefile +++ b/mbone/dbeacon/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.4 2014/10/06 10:04:17 he Exp $ +# $NetBSD: Makefile,v 1.5 2014/12/09 10:45:51 he Exp $ # DISTNAME= dbeacon-0.3.9.1 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= mbone MASTER_SITES= http://fivebits.net/files/dbeacon/ @@ -19,6 +19,8 @@ BUILD_DEFS+= IPV6_READY INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 share/examples/dbeacon INSTALLATION_DIRS+= share/doc/dbeacon +#INSTALL_UNSTRIPPED= yes + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/dbeacon ${DESTDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/docs/dbeacon.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 diff --git a/mbone/dbeacon/distinfo b/mbone/dbeacon/distinfo index 09c4df0929d..66d4f346fec 100644 --- a/mbone/dbeacon/distinfo +++ b/mbone/dbeacon/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.3 2014/10/06 10:04:17 he Exp $ +$NetBSD: distinfo,v 1.4 2014/12/09 10:45:51 he Exp $ SHA1 (dbeacon-0.3.9.1.tar.gz) = d6131e723a251c01d245fcb3ead864f1348e2565 RMD160 (dbeacon-0.3.9.1.tar.gz) = 81ec4cfe1c2890c7cdb5afbbd98fd2d0cf2a57a3 Size (dbeacon-0.3.9.1.tar.gz) = 43893 bytes -SHA1 (patch-contrib_matrix.pl) = 74fe26b6794470a254a95cf42483340d31837506 -SHA1 (patch-dbeacon.cpp) = 4e39bf5b4662ff7c0fae95a987e653c337bc33c2 +SHA1 (patch-contrib_matrix.pl) = 50a5db8c19e7500ef210b873c8dd114edde5dc40 +SHA1 (patch-dbeacon.cpp) = a666e67d9523d7cd2d11cd60b61e01c4f7f933c7 +SHA1 (patch-dbeacon.h) = 8396f6702402100f37cbae30d19cd2b0bb28fb4a +SHA1 (patch-dbeacon__posix.cpp) = e98bb2e6da3cc2119bbb962249b5c831a8feefc2 diff --git a/mbone/dbeacon/patches/patch-contrib_matrix.pl b/mbone/dbeacon/patches/patch-contrib_matrix.pl index fe7323134a0..e55588d745f 100644 --- a/mbone/dbeacon/patches/patch-contrib_matrix.pl +++ b/mbone/dbeacon/patches/patch-contrib_matrix.pl @@ -1,12 +1,13 @@ -$NetBSD: patch-contrib_matrix.pl,v 1.1 2014/10/06 10:04:17 he Exp $ +$NetBSD: patch-contrib_matrix.pl,v 1.2 2014/12/09 10:45:51 he Exp $ -Fix syntax errors flagged by newer perl. +Fix syntax errors flagged by newer perl: qw() doesn't act as a pair +of parentheses, so we need to add some of our own. Fix flag pointer, ref. https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html ---- contrib/matrix.pl.orig 2013-07-05 19:12:49.000000000 +0200 -+++ contrib/matrix.pl 2014-10-06 11:46:41.000000000 +0200 -@@ -29,7 +29,7 @@ +--- contrib/matrix.pl.orig 2007-07-12 10:17:53.000000000 +0000 ++++ contrib/matrix.pl +@@ -29,7 +29,7 @@ our $history_enabled = 0; our $css_file; our $dump_update_delay = 5; # time between each normal dumps # (used to detect outdated dump files) @@ -15,7 +16,7 @@ https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html our $default_ssm_group = 'ff3e::beac/10000'; our $debug = 0; our $matrix_link_title = 0; -@@ -423,7 +423,7 @@ +@@ -423,7 +423,7 @@ sub start_handler { $adj{$current_beacon}[RX_LOCAL] = $atts{'rxlocal'} if defined $atts{'rxlocal'}; } } elsif ($tag eq 'asm' or $tag eq 'ssm') { @@ -24,7 +25,21 @@ https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html if (defined $atts{$att}) { my $index = $tag eq 'ssm' ? 2 : 1; -@@ -884,7 +884,10 @@ +@@ -534,11 +534,11 @@ sub build_header { + my $whatatt = "what=$attwhat&"; + my $fullatt = "full=$full_matrix&"; + +- my @view = qw(ttl loss delay jitter); ++ my @view = (qw(ttl loss delay jitter)); + my @view_name = ('TTL', 'Loss', 'Delay', 'Jitter'); + my @view_type = ('hop count', 'percentage', 'ms', 'ms'); + +- my @sources = qw(asm ssm both ssmorasm); ++ my @sources = (qw(asm ssm both ssmorasm)); + my @sources_name = ('ASM', 'SSM', 'Both', 'SSM or ASM'); + + my $view_len = scalar(@view); +@@ -884,7 +884,10 @@ sub render_matrix { } } elsif ($a eq $b) { printx '<td ', $what_td, ' class="corner"> </td>'; @@ -36,7 +51,7 @@ https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html printx '<td ', $what_td, ' class="noreport">N/R</td>'; } else { printx '<td ', $what_td, ' class="blackhole">XX</td>'; -@@ -1171,7 +1174,7 @@ +@@ -1171,7 +1174,7 @@ sub store_data_one { update_ttl_hist(build_history_file_path($dst_h, $src_h) . "/$tag-ttl-hist", $adj{$dst}[NEIGH]{$src}[$index]{'ttl'}) if defined $adj{$dst}[NEIGH]{$src}[$index]{'ttl'}; @@ -45,7 +60,7 @@ https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html $values{$type} = $adj{$dst}[NEIGH]{$src}[$index]{$type}; $good++ if defined $values{$type}; } -@@ -1263,7 +1266,7 @@ +@@ -1263,7 +1266,7 @@ sub storedata { # Update rrd with new values my $updatestring = 'N'; @@ -54,7 +69,7 @@ https://lists.ubuntu.com/archives/ubuntu-motu/2010-January/006495.html # Store it in s and not ms $values{$valuetype} = $values{$valuetype} / 1000. if $valuetype eq 'delay' or $valuetype eq 'jitter'; $updatestring .= ':' . $values{$valuetype}; -@@ -1644,7 +1647,7 @@ +@@ -1644,7 +1647,7 @@ sub list_graph { my $count = 0; diff --git a/mbone/dbeacon/patches/patch-dbeacon.cpp b/mbone/dbeacon/patches/patch-dbeacon.cpp index d4acdba6d34..3799c227180 100644 --- a/mbone/dbeacon/patches/patch-dbeacon.cpp +++ b/mbone/dbeacon/patches/patch-dbeacon.cpp @@ -1,6 +1,7 @@ -$NetBSD: patch-dbeacon.cpp,v 1.1 2014/10/06 10:04:17 he Exp $ +$NetBSD: patch-dbeacon.cpp,v 1.2 2014/12/09 10:45:51 he Exp $ Fix pidfile option handling (in configuration file case). +Also, export log() for use elsewhere. --- dbeacon.cpp.orig 2007-07-13 13:52:14.000000000 +0000 +++ dbeacon.cpp @@ -13,6 +14,15 @@ Fix pidfile option handling (in configuration file case). static void next_event(timeval *); static void insert_event(uint32_t, uint32_t); +@@ -270,7 +270,7 @@ static void logv(int level, const char * + } + } + +-static void log(int level, const char *format, ...) ++void log(int level, const char *format, ...) + { + va_list vl; + va_start(vl, format); @@ -464,8 +464,8 @@ int main(int argc, char **argv) { perror("Failed to daemon()ize."); return -1; diff --git a/mbone/dbeacon/patches/patch-dbeacon.h b/mbone/dbeacon/patches/patch-dbeacon.h new file mode 100644 index 00000000000..465c2fb4929 --- /dev/null +++ b/mbone/dbeacon/patches/patch-dbeacon.h @@ -0,0 +1,14 @@ +$NetBSD: patch-dbeacon.h,v 1.1 2014/12/09 10:45:51 he Exp $ + +log() is also exported now. + +--- dbeacon.h.orig 2007-06-25 00:32:38.000000000 +0000 ++++ dbeacon.h +@@ -144,6 +144,7 @@ extern address beaconUnicastAddr; + + extern int verbose; + ++void log(int level, const char *format, ...); + void info(const char *format, ...); + void fatal(const char *format, ...); + diff --git a/mbone/dbeacon/patches/patch-dbeacon__posix.cpp b/mbone/dbeacon/patches/patch-dbeacon__posix.cpp new file mode 100644 index 00000000000..85aeecd4080 --- /dev/null +++ b/mbone/dbeacon/patches/patch-dbeacon__posix.cpp @@ -0,0 +1,38 @@ +$NetBSD: patch-dbeacon__posix.cpp,v 1.1 2014/12/09 10:45:51 he Exp $ + +Retry if times() returns with an error. +It has been known to return ((uint32_t)-1). + +--- dbeacon_posix.cpp.orig 2007-06-09 11:35:57.000000000 +0000 ++++ dbeacon_posix.cpp +@@ -25,6 +25,7 @@ + #include <sys/time.h> + #include <netdb.h> + #include <unistd.h> ++#include <syslog.h> + #include <sys/uio.h> + #include <sys/times.h> + +@@ -516,10 +517,19 @@ void address::set(const sockaddr *sa) { + + uint64_t get_timestamp() { + struct tms tmp; ++ clock_t clk; ++ int n = 0; + +- uint64_t v = times(&tmp); +- +- return (v * 1000) / sysconf(_SC_CLK_TCK); ++ retry: ++ clk = times(&tmp); ++ if (errno != 0) { ++ log(LOG_WARNING, "times() failed: %m"); ++ if (++n < 5) ++ goto retry; ++ else ++ log(LOG_ERR, "times() failed after 5 retries: %m"); ++ } ++ return (clk * 1000) / sysconf(_SC_CLK_TCK); + } + + uint64_t get_time_of_day() { |