* 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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user