From: Rich Felker Date: Tue, 22 Oct 2019 14:22:22 +0000 (-0400) Subject: fix errno for posix_openpt with no free ptys available X-Git-Tag: v1.2.0~85 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4fd0f2056082441a4503f6bfcb787a7c15754518;p=oweals%2Fmusl.git fix errno for posix_openpt with no free ptys available linux fails the open with ENOSPC, but POSIX mandates EAGAIN. --- diff --git a/src/misc/pty.c b/src/misc/pty.c index b9cb5eaa..a0577147 100644 --- a/src/misc/pty.c +++ b/src/misc/pty.c @@ -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)