mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 03:20:28 +08:00
* mingwex/dirent.c (_treaddir): Reset errno to 0 if end
of directory.
This commit is contained in:
parent
3a3f30763c
commit
c536f54ada
@ -1,3 +1,8 @@
|
|||||||
|
2003-10-03 Danny Smith <dannysmith@users.sourceforge.net>
|
||||||
|
|
||||||
|
* mingwex/dirent.c (_treaddir): Reset errno to 0 if end
|
||||||
|
of directory.
|
||||||
|
|
||||||
2003-09-29 Danny Smith <dannysmith@users.sourceforge.net>
|
2003-09-29 Danny Smith <dannysmith@users.sourceforge.net>
|
||||||
|
|
||||||
* include/stdlib.h: Guard non-ISO functions with
|
* include/stdlib.h: Guard non-ISO functions with
|
||||||
|
@ -165,7 +165,12 @@ _treaddir (_TDIR * dirp)
|
|||||||
/* Get the next search entry. */
|
/* Get the next search entry. */
|
||||||
if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta)))
|
if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta)))
|
||||||
{
|
{
|
||||||
/* We are off the end or otherwise error. */
|
/* We are off the end or otherwise error.
|
||||||
|
_findnext sets errno to ENOENT if no more file
|
||||||
|
Undo this. */
|
||||||
|
DWORD winerr = GetLastError();
|
||||||
|
if (winerr == ERROR_NO_MORE_FILES)
|
||||||
|
errno = 0;
|
||||||
_findclose (dirp->dd_handle);
|
_findclose (dirp->dd_handle);
|
||||||
dirp->dd_handle = -1;
|
dirp->dd_handle = -1;
|
||||||
dirp->dd_stat = -1;
|
dirp->dd_stat = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user