diff options
author | Jameson Nash <vtjnash@gmail.com> | 2018-11-05 16:03:19 -0500 |
---|---|---|
committer | Jameson Nash <vtjnash@gmail.com> | 2018-11-29 11:21:44 -0500 |
commit | c5593b51dc98715f7f32a919301b5801ebf1a8ce (patch) | |
tree | 68083703aa316ca99eaf1ebd4e423ccf64dc9a57 /test/test-emfile.c | |
parent | f1981d74ba880f010bfde6c98647bbb426a6d126 (diff) | |
download | libuv-c5593b51dc98715f7f32a919301b5801ebf1a8ce.tar.gz libuv-c5593b51dc98715f7f32a919301b5801ebf1a8ce.zip |
warnings: fix code that emits compiler warnings
PR-URL: https://github.com/libuv/libuv/pull/2066
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test/test-emfile.c')
-rw-r--r-- | test/test-emfile.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/test-emfile.c b/test/test-emfile.c index 8e44ac5c..bc1fce5f 100644 --- a/test/test-emfile.c +++ b/test/test-emfile.c @@ -38,6 +38,11 @@ static uv_tcp_t client_handle; TEST_IMPL(emfile) { + struct sockaddr_in addr; + struct rlimit limits; + uv_connect_t connect_req; + uv_loop_t* loop; + int first_fd; #if defined(_AIX) || defined(__MVS__) /* On AIX, if a 'accept' call fails ECONNRESET is set on the socket * which causes uv__emfile_trick to not work as intended and this test @@ -45,11 +50,6 @@ TEST_IMPL(emfile) { */ RETURN_SKIP("uv__emfile_trick does not work on this OS"); #endif - struct sockaddr_in addr; - struct rlimit limits; - uv_connect_t connect_req; - uv_loop_t* loop; - int first_fd; /* Lower the file descriptor limit and use up all fds save one. */ limits.rlim_cur = limits.rlim_max = maxfd + 1; @@ -114,4 +114,8 @@ static void connect_cb(uv_connect_t* req, int status) { uv_close((uv_handle_t*) &client_handle, NULL); } -#endif /* !defined(_WIN32) */ +#else + +typedef int file_has_no_tests; /* ISO C forbids an empty translation unit. */ + +#endif /* !_WIN32 */ |