summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-05 10:30:50 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-05 10:30:50 -0400
commitb4bd4964eba5b0dae811a5c28c664b8f78a0672c (patch)
tree724c575c34c06ed78f4642b2fc2ecb7bde7f4d31
parent981e896dd2eaf69798bb503c271306ee779dd6d2 (diff)
parent0bec9f320b81a85ba3596e9780b1cf7c770dfb31 (diff)
downloadtor-b4bd4964eba5b0dae811a5c28c664b8f78a0672c.tar.gz
tor-b4bd4964eba5b0dae811a5c28c664b8f78a0672c.zip
Merge remote-tracking branch 'public/format_doubles'
Conflicts: src/or/geoip.c
-rw-r--r--changes/bug3894_fmt_doubles4
-rw-r--r--src/or/dirserv.c2
-rw-r--r--src/or/geoip.c4
-rw-r--r--src/or/rephist.c6
4 files changed, 10 insertions, 6 deletions
diff --git a/changes/bug3894_fmt_doubles b/changes/bug3894_fmt_doubles
new file mode 100644
index 0000000000..0cd0aa28d1
--- /dev/null
+++ b/changes/bug3894_fmt_doubles
@@ -0,0 +1,4 @@
+ o Minor bugfixes:
+ - Format more doubles with %f, not %lf. Patch from grarpamp to make
+ Tor build correctly on older BSDs again. Fixes bug 3894; bugfix on
+ Tor 0.2.0.8-alpha.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 01a5618597..ef6c35e739 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1995,7 +1995,7 @@ dirserv_compute_performance_thresholds(routerlist_t *rl)
log(LOG_INFO, LD_DIRSERV,
"Cutoffs: For Stable, %lu sec uptime, %lu sec MTBF. "
"For Fast: %lu bytes/sec. "
- "For Guard: WFU %.03lf%%, time-known %lu sec, "
+ "For Guard: WFU %.03f%%, time-known %lu sec, "
"and bandwidth %lu or %lu bytes/sec. We%s have enough stability data.",
(unsigned long)stable_uptime,
(unsigned long)stable_mtbf,
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 68a1942898..5d6488817a 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -1025,9 +1025,9 @@ geoip_format_dirreq_stats(time_t now)
#undef RESPONSE_GRANULARITY
if (!geoip_get_mean_shares(now, &v2_share, &v3_share)) {
- tor_asprintf(&v2_share_string, "dirreq-v2-share %0.2lf%%\n",
+ tor_asprintf(&v2_share_string, "dirreq-v2-share %0.2f%%\n",
v2_share*100);
- tor_asprintf(&v3_share_string, "dirreq-v3-share %0.2lf%%\n",
+ tor_asprintf(&v3_share_string, "dirreq-v3-share %0.2f%%\n",
v3_share*100);
}
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 02d38e4507..ec5b84692e 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -839,7 +839,7 @@ rep_hist_record_mtbf_data(time_t now, int missing_means_down)
format_iso_time(time_buf, hist->start_of_run);
t = time_buf;
}
- PRINTF((f, "+MTBF %lu %.5lf%s%s\n",
+ PRINTF((f, "+MTBF %lu %.5f%s%s\n",
hist->weighted_run_length, hist->total_run_weights,
t ? " S=" : "", t ? t : ""));
t = NULL;
@@ -889,10 +889,10 @@ rep_hist_format_router_status(or_history_t *hist, time_t now)
tor_asprintf(&cp,
"%s%s%s"
"%s%s%s"
- "wfu %0.3lf\n"
+ "wfu %0.3f\n"
" weighted-time %lu\n"
" weighted-uptime %lu\n"
- "mtbf %0.1lf\n"
+ "mtbf %0.1f\n"
" weighted-run-length %lu\n"
" total-run-weights %f\n",
up?"uptime-started ":"", up?sor_buf:"", up?" UTC\n":"",