From 991f6ee044cf28fe5672670ef5f214096eee2b5d Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 4 Sep 2011 18:45:41 -0700 Subject: [PATCH] unix: Set req->result to -1 on async uv_fs_readdir error fixes test/simple/test-fs-error-messages.js in node. --- src/unix/fs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/fs.c b/src/unix/fs.c index 7ca2275f..e0dc47d7 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -305,6 +305,7 @@ int uv_fs_readdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, DIR* dir = opendir(path); if (!dir) { uv_err_new(loop, errno); + req->result = -1; return -1; } @@ -333,6 +334,7 @@ int uv_fs_readdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, r = closedir(dir); if (r) { uv_err_new(loop, errno); + req->result = -1; return -1; } }