+2010-04-25 Bruno Haible <bruno@clisp.org>
+
+ ptsname: Fix misuse of ttyname_r.
+ * lib/ptsname.c (__ptsname_r): Use __ttyname_r's return value instead
+ of errno.
+
2010-04-25 Bruno Haible <bruno@clisp.org>
ttyname_r: Make it work on Solaris 10.
__ptsname_r (int fd, char *buf, size_t buflen)
{
int save_errno = errno;
+ int err;
struct stat st;
if (buf == NULL)
return ERANGE;
}
- if (__ttyname_r (fd, buf, buflen) != 0)
- return errno;
+ err = __ttyname_r (fd, buf, buflen);
+ if (err != 0)
+ {
+ __set_errno (err);
+ return errno;
+ }
buf[sizeof (_PATH_DEV) - 1] = 't';