Path: utzoo!mnetor!uunet!ndsuvax!ncpascal From: ncpascal@ndsuvax.UUCP (Freeman Pascal) Newsgroups: comp.os.minix Subject: Bug in my ttyname(3)! Message-ID: <583@ndsuvax.UUCP> Date: 17 Dec 87 17:48:35 GMT Reply-To: ncpascal@ndsuvax.UUCP (Freeman Pascal) Organization: North Dakota State University Fargo, ND Lines: 17 Keywords: bug fix ttyname MINIX 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)) {