A bogus check for a char device also matched symbolic links.

Replace it with a correct check using S_ISCHR()

Symbolic links will now work again in linux compatibility.
This commit is contained in:
Paul Richards 2001-04-25 22:07:16 +00:00
parent 4b21204b19
commit 9ca3a84af2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75988

View File

@ -120,7 +120,7 @@ newstat_copyout(struct stat *buf, void *ubuf)
/* Lie about disk drives which are character devices
* in FreeBSD but block devices under Linux.
*/
if (tbuf.stat_mode & S_IFCHR &&
if (S_ISCHR(tbuf.stat_mode) &&
(dev = udev2dev(buf->st_rdev, 0)) != NODEV) {
cdevsw = devsw(dev);
if (cdevsw != NULL && (cdevsw->d_flags & D_DISK)) {