aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-24 08:53:12 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-24 08:53:12 +0000
commitb253510019eb2b3334a797a2c09d86ae0b3e97f5 (patch)
treef10f6c92e4db8635a7ac4d46901ba7df5edffba1
parent8fede42a8013b9a3e3b2dbab687b403319227a79 (diff)
downloadgnunet-b253510019eb2b3334a797a2c09d86ae0b3e97f5.tar.gz
gnunet-b253510019eb2b3334a797a2c09d86ae0b3e97f5.zip
-LRN: Log timeouts that are bigger than DWORD; fix format string
-rw-r--r--src/util/network.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/util/network.c b/src/util/network.c
index ca8105fc7..f550c18b2 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -1296,7 +1296,14 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1296 if (timeout.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) 1296 if (timeout.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
1297 ms_total = INFINITE; 1297 ms_total = INFINITE;
1298 else 1298 else
1299 {
1299 ms_total = timeout.rel_value / GNUNET_TIME_UNIT_MILLISECONDS.rel_value; 1300 ms_total = timeout.rel_value / GNUNET_TIME_UNIT_MILLISECONDS.rel_value;
1301 if (timeout.rel_value / GNUNET_TIME_UNIT_MILLISECONDS.rel_value > 0xFFFFFFFFLL - 1)
1302 {
1303 GNUNET_break (0);
1304 ms_total = 0xFFFFFFFF - 1;
1305 }
1306 }
1300 /* select() may be used as a portable way to sleep */ 1307 /* select() may be used as a portable way to sleep */
1301 if (!(rfds || wfds || efds)) 1308 if (!(rfds || wfds || efds))
1302 { 1309 {
@@ -1513,8 +1520,8 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1513 } 1520 }
1514 1521
1515 handle_array[nhandles] = NULL; 1522 handle_array[nhandles] = NULL;
1516 LOG (GNUNET_ERROR_TYPE_DEBUG, "nfds: %d, handles: %d, will wait: %d ms\n", 1523 LOG (GNUNET_ERROR_TYPE_DEBUG, "nfds: %d, handles: %d, will wait: %llu ms\n",
1517 nfds, nhandles, ms_total); 1524 nfds, nhandles, (unsigned long long) ms_total);
1518 if (nhandles) 1525 if (nhandles)
1519 returncode = 1526 returncode =
1520 WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total); 1527 WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total);