Fix two minor nits.

Existences revealed, but no details offered by: bp
This commit is contained in:
Poul-Henning Kamp 2001-01-30 08:39:52 +00:00
parent d2a57575f1
commit aadf265525
2 changed files with 6 additions and 2 deletions

View File

@ -200,7 +200,8 @@ devfs_newdirent(char *name, int namelen)
de->de_dirent = (struct dirent *)(de + 1);
de->de_dirent->d_namlen = namelen;
de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d);
bcopy(name, de->de_dirent->d_name, namelen + 1);
bcopy(name, de->de_dirent->d_name, namelen);
de->de_dirent->d_name[namelen] = '\0';
nanotime(&de->de_ctime);
de->de_mtime = de->de_atime = de->de_ctime;
de->de_links = 1;

View File

@ -153,7 +153,10 @@ devfs_getattr(ap)
vap->va_uid = de->de_uid;
vap->va_gid = de->de_gid;
vap->va_mode = de->de_mode;
vap->va_size = 0;
if (vp->v_type == VLNK)
vap->va_size = de->de_dirent->d_namlen;
else
vap->va_size = 0;
vap->va_blocksize = DEV_BSIZE;
vap->va_type = vp->v_type;
if (vp->v_type != VCHR) {