test: fix order of operations in test

In the fs_readdir_empty_dir test, the uv_fs_readdir() request is
cleaned up after calling uv_fs_closedir(). However, the readdir
request should be cleaned up before calling uv_fs_closedir().

Fixes: https://github.com/libuv/libuv/issues/2496
PR-URL: https://github.com/libuv/libuv/pull/2497
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
cjihrig 2019-09-29 10:43:41 -04:00
parent 645be48a80
commit f47f01b57c
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -62,12 +62,12 @@ static void empty_readdir_cb(uv_fs_t* req) {
ASSERT(req->fs_type == UV_FS_READDIR);
ASSERT(req->result == 0);
dir = req->ptr;
uv_fs_req_cleanup(req);
r = uv_fs_closedir(uv_default_loop(),
&closedir_req,
dir,
empty_closedir_cb);
ASSERT(r == 0);
uv_fs_req_cleanup(req);
}
static void empty_opendir_cb(uv_fs_t* req) {