unix: Set req->result to -1 on async uv_fs_readdir error

fixes test/simple/test-fs-error-messages.js in node.
This commit is contained in:
Ryan Dahl 2011-09-04 18:45:41 -07:00
parent be3b37854e
commit 991f6ee044

View File

@ -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;
}
}