mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 17:54:52 +00:00
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:
parent
0e8363eca9
commit
726bd7bebf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62219
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue