Skip to content

Commit 25a3894

Browse files
bnoordhuiscjihrig
authored andcommitted
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: #2023 (comment) PR-URL: #2025 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 672b96f commit 25a3894

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/unix/fs.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,6 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
265265
unsigned int iovmax;
266266
ssize_t result;
267267

268-
#if defined(_AIX)
269-
struct stat buf;
270-
result = fstat(req->file, &buf);
271-
if (result)
272-
goto done;
273-
if (S_ISDIR(buf.st_mode)) {
274-
errno = EISDIR;
275-
result -1;
276-
goto done;
277-
}
278-
#endif /* defined(_AIX) */
279-
280268
iovmax = uv__getiovmax();
281269
if (req->nbufs > iovmax)
282270
req->nbufs = iovmax;

0 commit comments

Comments
 (0)