Skip to content

Commit

Permalink
core: replace uv_fs_readdir with uv_fs_scandir
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node-v0.x-archive#8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
saghul authored and trevnorris committed Nov 6, 2014
1 parent ce112c2 commit a5f1307
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ static void After(uv_fs_t *req) {
argv[1] = Integer::New(env->isolate(), req->result);
break;

case UV_FS_READDIR:
case UV_FS_SCANDIR:
{
int r;
Local<Array> names = Array::New(env->isolate(), 0);

for (int i = 0; ; i++) {
uv_dirent_t ent;

r = uv_fs_readdir_next(req, &ent);
r = uv_fs_scandir_next(req, &ent);
if (r == UV_EOF)
break;
if (r != 0) {
Expand Down Expand Up @@ -710,9 +710,9 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) {
node::Utf8Value path(args[0]);

if (args[1]->IsFunction()) {
ASYNC_CALL(readdir, args[1], *path, 0 /*flags*/)
ASYNC_CALL(scandir, args[1], *path, 0 /*flags*/)
} else {
SYNC_CALL(readdir, *path, *path, 0 /*flags*/)
SYNC_CALL(scandir, *path, *path, 0 /*flags*/)

assert(SYNC_REQ.result >= 0);
int r;
Expand All @@ -721,7 +721,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) {
for (int i = 0; ; i++) {
uv_dirent_t ent;

r = uv_fs_readdir_next(&SYNC_REQ, &ent);
r = uv_fs_scandir_next(&SYNC_REQ, &ent);
if (r == UV_EOF)
break;
if (r != 0)
Expand Down

0 comments on commit a5f1307

Please sign in to comment.