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:
parent
be3b37854e
commit
991f6ee044
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user