[tor-commits] [tor/release-0.3.1] Fix mixed-sign comparison warning in fix for 22797.

nickm at torproject.org nickm at torproject.org
Wed Jul 5 19:57:17 UTC 2017


commit 9383fa3851a47e4db83bccdb923760e059ac7941
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jul 5 15:56:57 2017 -0400

    Fix mixed-sign comparison warning in fix for 22797.
---
 src/common/compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/compat.c b/src/common/compat.c
index fb712f2..3bea626 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -1733,7 +1733,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
     int bad = 1;
 #ifdef OPEN_MAX
     uint64_t try_limit = OPEN_MAX - ULIMIT_BUFFER;
-    if (errno == EINVAL && try_limit < rlim.rlim_cur) {
+    if (errno == EINVAL && try_limit < (uint64_t) rlim.rlim_cur) {
       /* On some platforms, OPEN_MAX is the real limit, and getrlimit() is
        * full of nasty lies.  I'm looking at you, OSX 10.5.... */
       rlim.rlim_cur = try_limit;





More information about the tor-commits mailing list