X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fdirent%2Ffdopendir.c;h=c684a866a3079d1d46a1d403615c4568a9713249;hb=28af39fe427ffec8b836f4f30450ffc30b03e5c4;hp=c4b8e61d2a53a73b5eb5b34c6e7d48df1720b507;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/dirent/fdopendir.c b/src/dirent/fdopendir.c index c4b8e61d..c684a866 100644 --- a/src/dirent/fdopendir.c +++ b/src/dirent/fdopendir.c @@ -12,7 +12,10 @@ DIR *fdopendir(int fd) DIR *dir; struct stat st; - if (fstat(fd, &st) < 0 || !S_ISDIR(st.st_mode)) { + if (fstat(fd, &st) < 0) { + return 0; + } + if (!S_ISDIR(st.st_mode)) { errno = ENOTDIR; return 0; }