Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-08-19 23:25:54 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-08-19 23:25:54 +0400
commit905a851912b3f01baa8c797fa6e84081c84b2390 (patch)
tree33b50e1500e86f68fbdb689199af5ff498765206 /winsup/cygwin/dir.cc
parent59c3d5a1a4c0d8ee4f1da2c9e449ed9ab4edd4b6 (diff)
* dir.cc (dirfd): Per POSIX, return EINVAL on invalid directory stream.
(telldir): Per POSIX, return -1 and set errno to EBADF, rather than just returning 0, on invalid directory stream. * signal.cc (sigwaitinfo): Return -1, not EFAULT, when SEGV was catched.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 01b9ab882..b1035ba49 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -33,7 +33,7 @@ dirfd (DIR *dir)
return -1;
if (dir->__d_cookie != __DIRENT_COOKIE)
{
- set_errno (EBADF);
+ set_errno (EINVAL);
syscall_printf ("-1 = dirfd (%p)", dir);
return -1;
}
@@ -205,7 +205,10 @@ telldir (DIR *dir)
return -1;
if (dir->__d_cookie != __DIRENT_COOKIE)
- return 0;
+ {
+ set_errno (EBADF);
+ return -1;
+ }
return ((fhandler_base *) dir->__fh)->telldir (dir);
}