diff options
author | cypherpunks <cypherpunks@torproject.org> | 2015-12-17 15:09:34 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-17 12:18:07 -0500 |
commit | 54d9632cdd4640dce5bff78cdac9b8b063367f5a (patch) | |
tree | f87e5147b2f5fa7d4aa509dd71fbce147d5fb043 /src/test/test_switch_id.c | |
parent | 4bb72a4d12ee899c85283e2e6ae518d08497a263 (diff) | |
download | tor-54d9632cdd4640dce5bff78cdac9b8b063367f5a.tar.gz tor-54d9632cdd4640dce5bff78cdac9b8b063367f5a.zip |
Fix unused variable errors
Diffstat (limited to 'src/test/test_switch_id.c')
-rw-r--r-- | src/test/test_switch_id.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c index ebae99af08..3d9c1c8bba 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"); |