From ca2590f422b5d553829662aebfb42f6d5c2f982c Mon Sep 17 00:00:00 2001 From: delphij Date: Sat, 14 May 2005 14:03:21 +0000 Subject: 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 --- lib/libc/gen/ttyname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c index 54bc24b..56e7ce1 100644 --- a/lib/libc/gen/ttyname.c +++ b/lib/libc/gen/ttyname.c @@ -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); -- cgit v1.1