diff options
author | ngie <ngie@FreeBSD.org> | 2016-01-21 05:59:33 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-01-21 05:59:33 +0000 |
commit | d5dcdbe9cc952c698fa3bd596375e7f7d18de655 (patch) | |
tree | 119882c48c1d21da8c136475a0d751f111fc172b /tools/regression | |
parent | 1765ee7015938758be65f075e488810c76916f53 (diff) | |
download | FreeBSD-src-d5dcdbe9cc952c698fa3bd596375e7f7d18de655.zip FreeBSD-src-d5dcdbe9cc952c698fa3bd596375e7f7d18de655.tar.gz |
MFC r294126:
Fix warnings with gcc 5.0
reconnect.c:
- Convert the K&R prototype of main to an ANSI prototype to mute a
warning from gcc 4.2.1
- Close s_sock2 after finishing off the last test to plug a leak and
mute a warning from gcc 5.0 about a -Wunused-but-set variable
sendfile.c:
- Fix a -Wunused-but-set warning with gcc 5.0 with pagesize in main(..)
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/sockets/reconnect/reconnect.c | 3 | ||||
-rw-r--r-- | tools/regression/sockets/sendfile/sendfile.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/tools/regression/sockets/reconnect/reconnect.c b/tools/regression/sockets/reconnect/reconnect.c index 27f32cc..985d6d7 100644 --- a/tools/regression/sockets/reconnect/reconnect.c +++ b/tools/regression/sockets/reconnect/reconnect.c @@ -104,7 +104,7 @@ cleanup(void) } int -main() +main(void) { int s_sock1, s_sock2, c_sock; @@ -127,6 +127,7 @@ main() connect_uds_server(c_sock, uds_name1); close(s_sock1); connect_uds_server(c_sock, uds_name2); + close(s_sock2); exit (0); } diff --git a/tools/regression/sockets/sendfile/sendfile.c b/tools/regression/sockets/sendfile/sendfile.c index 18ae9ad..3a59234 100644 --- a/tools/regression/sockets/sendfile/sendfile.c +++ b/tools/regression/sockets/sendfile/sendfile.c @@ -459,12 +459,9 @@ cleanup(void) int main(int argc, char *argv[]) { - int pagesize; path[0] = '\0'; - pagesize = getpagesize(); - if (argc == 1) { snprintf(path, sizeof(path), "sendfile.XXXXXXXXXXXX"); file_fd = mkstemp(path); |