From 25a3894c8d59fada12253d3cb1befd14e18ecd75 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 8 Oct 2018 11:16:34 +0200 Subject: [PATCH] aix: don't EISDIR on read from directory fd Remove the artificial EISDIR that was generated when trying to uv_fs_read() from a file descriptor that refers to a directory. We don't do that on the BSDs either (where reading from a directory is allowed) and it introduces an extra stat() call for every read. Refs: https://github.com/libuv/libuv/pull/2023#issuecomment-427759265 PR-URL: https://github.com/libuv/libuv/pull/2025 Reviewed-By: Santiago Gimeno Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau --- src/unix/fs.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index a0c05e18..3db5f89c 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -265,18 +265,6 @@ static ssize_t uv__fs_read(uv_fs_t* req) { unsigned int iovmax; ssize_t result; -#if defined(_AIX) - struct stat buf; - result = fstat(req->file, &buf); - if (result) - goto done; - if (S_ISDIR(buf.st_mode)) { - errno = EISDIR; - result -1; - goto done; - } -#endif /* defined(_AIX) */ - iovmax = uv__getiovmax(); if (req->nbufs > iovmax) req->nbufs = iovmax;