From f47f01b57c806f7bcb99e5c7df569a69dd480595 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 29 Sep 2019 10:43:41 -0400 Subject: [PATCH] test: fix order of operations in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Saúl Ibarra Corretgé --- test/test-fs-readdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-fs-readdir.c b/test/test-fs-readdir.c index a767f1fb..5efc853c 100644 --- a/test/test-fs-readdir.c +++ b/test/test-fs-readdir.c @@ -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) {