Revert to old ttyname_r behavior that when _ioctl() returns 0 (SUCCEEDED),

return the buffer immediately.  This will permit ssh and/or PAM logins
broken by previous commit.

The (potential) underlying problem is still under investigation.

Point hat to:	me
This commit is contained in:
Xin LI 2005-05-14 14:03:21 +00:00
parent 914ee8ba4b
commit 68b749ff2f

View File

@ -83,7 +83,7 @@ ttyname_r(int fd, char *buf, size_t len)
fgn.len = len - strlen(buf);
fgn.buf = buf + strlen(buf);
if (!_ioctl(fd, FIODGNAME, &fgn))
return (EINVAL);
return (0);
devname_r(sb.st_rdev, S_IFCHR,
buf + strlen(buf), sizeof(buf) - strlen(buf));
return (0);