projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b2921b
)
fix errno for posix_openpt with no free ptys available
author
Rich Felker
<dalias@aerifal.cx>
Tue, 22 Oct 2019 14:22:22 +0000
(10:22 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 24 Oct 2019 14:25:09 +0000
(10:25 -0400)
linux fails the open with ENOSPC, but POSIX mandates EAGAIN.
src/misc/pty.c
patch
|
blob
|
history
diff --git
a/src/misc/pty.c
b/src/misc/pty.c
index b9cb5eaad592597ab3ca4ed91be33b07d1c2da49..a0577147a4c2b6ef251ede679d56354b406fbb4c 100644
(file)
--- 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)