fix errno for posix_openpt with no free ptys available

linux fails the open with ENOSPC, but POSIX mandates EAGAIN.
This commit is contained in:
Rich Felker 2019-10-22 10:22:22 -04:00
parent 9b2921bea1
commit 4fd0f20560

View File

@ -7,7 +7,9 @@
int posix_openpt(int flags)
{
return open("/dev/ptmx", flags);
int r = open("/dev/ptmx", flags);
if (r < 0 && errno == ENOSPC) errno = EAGAIN;
return r;
}
int grantpt(int fd)