fdesc_getattr:

Don't fake any file types, just set vap->va_type to IFTOVT(stb.st_mode).
  If something does not report its mode, vap->va_type is set to VNON
  accordingly.
This commit is contained in:
Chris Costello 2000-06-28 19:18:25 +00:00
parent 0e8363eca9
commit 726bd7bebf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62219
2 changed files with 4 additions and 12 deletions

View file

@ -330,15 +330,11 @@ fdesc_getattr(ap)
break;
default:
bzero(&stb, sizeof(stb));
error = fo_stat(fp, &stb, ap->a_p);
if (error == 0) {
VATTR_NULL(vap);
/* XXX Fake it! */
if (fp->f_type != DTYPE_PIPE && fp->f_type != DTYPE_SOCKET)
vap->va_type = VFIFO;
else
vap->va_type = IFTOVT(stb.st_mode);
vap->va_type = IFTOVT(stb.st_mode);
vap->va_mode = S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP | S_IROTH | S_IWOTH;
vap->va_nlink = 1;

View file

@ -330,15 +330,11 @@ fdesc_getattr(ap)
break;
default:
bzero(&stb, sizeof(stb));
error = fo_stat(fp, &stb, ap->a_p);
if (error == 0) {
VATTR_NULL(vap);
/* XXX Fake it! */
if (fp->f_type != DTYPE_PIPE && fp->f_type != DTYPE_SOCKET)
vap->va_type = VFIFO;
else
vap->va_type = IFTOVT(stb.st_mode);
vap->va_type = IFTOVT(stb.st_mode);
vap->va_mode = S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP | S_IROTH | S_IWOTH;
vap->va_nlink = 1;