[tor-commits] [tor/master] Fix unused variable errors

nickm at torproject.org nickm at torproject.org
Thu Dec 17 17:18:58 UTC 2015


commit 54d9632cdd4640dce5bff78cdac9b8b063367f5a
Author: cypherpunks <cypherpunks at torproject.org>
Date:   Thu Dec 17 15:09:34 2015 +0100

    Fix unused variable errors
---
 src/test/test_switch_id.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c
index ebae99a..3d9c1c8 100644
--- a/src/test/test_switch_id.c
+++ b/src/test/test_switch_id.c
@@ -14,8 +14,6 @@
 #define TEST_SETUID_KEEPCAPS         4
 #define TEST_SETUID_STRICT           5
 
-static const char *username;
-
 static const struct {
   const char *name;
   int test_id;
@@ -29,6 +27,7 @@ static const struct {
   { NULL, 0 }
 };
 
+#if !defined(_WIN32)
 /* 0 on no, 1 on yes, -1 on failure. */
 static int
 check_can_bind_low_ports(void)
@@ -63,11 +62,7 @@ check_can_bind_low_ports(void)
     } else if (errno == EACCES || errno == EPERM) {
       /* Got a permission-denied error. */
       return 0;
-#if defined(_WIN32)
-    } else if (errno == WSAEADDRINUSE) {
-#else
     } else if (errno == EADDRINUSE) {
-#endif
       /* Huh; somebody is using that port. */
     } else {
       perror("bind");
@@ -76,6 +71,7 @@ check_can_bind_low_ports(void)
 
   return -1;
 }
+#endif
 
 int
 main(int argc, char **argv)
@@ -87,6 +83,7 @@ main(int argc, char **argv)
   fprintf(stderr, "This test is not supported on your OS.\n");
   return 77;
 #else
+  const char *username;
   const char *testname;
   if (argc != 3) {
     fprintf(stderr, "I want 2 arguments: a username and a command.\n");



More information about the tor-commits mailing list