Skip to content

Commit

Permalink
Avoid handling long-obsolete old BSD PTY handling in ptsname.
Browse files Browse the repository at this point in the history
Support for this type of PTY was removed in the 2.1.115 kernel.  Just
use __LINUX_KERNEL_VERSION to determine when we can drop the compat code.
  • Loading branch information
Ulrich Drepper committed Nov 26, 2009
1 parent c53f622 commit e2c59de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2009-11-26 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): Avoid code
only used on truly ancient kernel if configuration requires a more
recent kernel.

2009-11-24 Ulrich Drepper <drepper@redhat.com>

[BZ #3662]
Expand Down
2 changes: 2 additions & 0 deletions sysdeps/unix/sysv/linux/ptsname.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
}

ptyno = minor (stp->st_rdev);
#if __LINUX_KERNEL_VERSION >= 131443
/* This is for the old BSD pseudo terminals. As of Linux
2.1.115 these are no longer supported. */
if (major (stp->st_rdev) == 4)
ptyno -= 128;
#endif

if (ptyno / 16 >= strlen (__libc_ptyname1))
{
Expand Down

0 comments on commit e2c59de

Please sign in to comment.