From 76216d8057a8f612921be9bdde262c2e074b8a6c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 14 Sep 2011 17:58:35 +0200 Subject: [PATCH] unix: handle readdir errors in uv__fs_after() --- src/unix/fs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/fs.c b/src/unix/fs.c index cab41064..554ef903 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -116,6 +116,9 @@ static int uv__fs_after(eio_req* eio) { switch (req->fs_type) { case UV_FS_READDIR: + if (req->eio->result == -1) + break; /* opendir() or readdir() operation failed. */ + /* * XXX This is pretty bad. * We alloc and copy the large null terminated string list from libeio.