mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-02 13:05:42 +08:00
Cygwin: ptsname_r: always return an error number on failure
Return EBADF on a bad file descriptor. Previously 0 was returned, in violation of the requirement in https://man7.org/linux/man-pages/man3/ptsname_r.3.html that an error number should be returned on failure. We are intentionally deviating from Linux, on which ENOTTY is returned. Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00245.html
This commit is contained in:
parent
4aefad2bb8
commit
a60a4501b7
@ -52,3 +52,6 @@ Bug Fixes
|
|||||||
- Fix the errno when a path contains .. and the prefix exists but is
|
- Fix the errno when a path contains .. and the prefix exists but is
|
||||||
not a directory.
|
not a directory.
|
||||||
Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00214.html
|
Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00214.html
|
||||||
|
|
||||||
|
- Fix the return value when ptsname_r(3) is called with a bad file descriptor
|
||||||
|
Addresses: https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00245.html
|
||||||
|
@ -3392,7 +3392,7 @@ ptsname_r (int fd, char *buf, size_t buflen)
|
|||||||
|
|
||||||
cygheap_fdget cfd (fd);
|
cygheap_fdget cfd (fd);
|
||||||
if (cfd < 0)
|
if (cfd < 0)
|
||||||
return 0;
|
return EBADF;
|
||||||
return cfd->ptsname_r (buf, buflen);
|
return cfd->ptsname_r (buf, buflen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user