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:
611eabd
)
fix negated error codes from ptsname_r
author
Rich Felker
<dalias@aerifal.cx>
Mon, 17 Mar 2014 04:25:23 +0000
(
00:25
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 17 Mar 2014 04:25:23 +0000
(
00:25
-0400)
the incorrect error codes also made their way into errno when
__ptsname_r was called by plain ptsname, which reports errors via
errno rather than a return value.
src/misc/pty.c
patch
|
blob
|
history
diff --git
a/src/misc/pty.c
b/src/misc/pty.c
index 9e201ef3218b41bf8863ebabca04a845ddad70e0..b395d2c09e14f19bad0d7130de8c0a9c1cc14fd4 100644
(file)
--- a/
src/misc/pty.c
+++ b/
src/misc/pty.c
@@
-26,7
+26,7
@@
int __ptsname_r(int fd, char *buf, size_t len)
{
int pty, err;
if (!buf) len = 0;
- if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return err;
+ if ((err = __syscall(SYS_ioctl, fd, TIOCGPTN, &pty))) return
-
err;
if (snprintf(buf, len, "/dev/pts/%d", pty) >= len) return ERANGE;
return 0;
}