diff options
author | phk <phk@FreeBSD.org> | 2001-01-30 08:39:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-01-30 08:39:52 +0000 |
commit | 006cf45cd7b8f3df2de6c176a3f8d62e4071b835 (patch) | |
tree | 6dc1c08c32e972ae768961a55ec9487e9ed420c9 /sys | |
parent | 8cb2e82b698dc0ebe9b6031120670f616c4d2c9a (diff) | |
download | FreeBSD-src-006cf45cd7b8f3df2de6c176a3f8d62e4071b835.zip FreeBSD-src-006cf45cd7b8f3df2de6c176a3f8d62e4071b835.tar.gz |
Fix two minor nits.
Existences revealed, but no details offered by: bp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 3 | ||||
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index bb6b316..30558ec 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -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; diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index fad4ec7..4337bd2 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -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) { |