[comp.os.minix] Bug in my ttyname

ncpascal@ndsuvax.UUCP (Freeman Pascal) (12/18/87)

Hello,
    In my past posting for tty(1) I inadvertently allowed a bug to get
past me.  Here are the diffs to fix ttyname(3).  The ttyname(3) I posted
will work only because of the way U**X and MINIX set up their directory
structure and where they place their devices.  This fix will check if
the devices are also the same and keep ttyname() honest.

				Freeman P. Pascal IV
				ncpascal@ndsuvax

--------------------------  Cut here for diff  -------------------------------

64c64,65
< 	if ( dev_stat.st_ino == fd_stat.st_ino ) {
---
> 	if (( dev_stat.st_ino == fd_stat.st_ino ) &&
> 		(dev_stat.st_dev == fd_stat.st_dev)) {