aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-13 19:30:02 -0500
committerRuss Cox <rsc@swtch.com>2020-01-13 19:30:02 -0500
commit3a62e5630748d788166a50ed34b7f0dc6d43a5ee (patch)
tree7d969b7b240755a6fe5224eb78c69510affdba2e /src
parent6c17f630901eec2a4b54b70748d7fbc9b47eecd8 (diff)
downloadplan9port-3a62e5630748d788166a50ed34b7f0dc6d43a5ee.tar.gz
plan9port-3a62e5630748d788166a50ed34b7f0dc6d43a5ee.tar.bz2
plan9port-3a62e5630748d788166a50ed34b7f0dc6d43a5ee.zip
lib9: do not fetch disk size for character devices
Real disk devices should be block devices anyway. One user reported the disksize check causing a system reboot during vac of a tree with an "interesting" device. Fixes #103.
Diffstat (limited to 'src')
-rw-r--r--src/lib9/_p9dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c
index 0fb3410e..58c63573 100644
--- a/src/lib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -230,7 +230,7 @@ _p9dir(struct stat *lst, struct stat *st, char *name, Dir *d, char **str, char *
d->qid.path = ('c'<<16)|st->st_rdev;
}
/* fetch real size for disks */
- if(S_ISBLK(lst->st_mode) || S_ISCHR(lst->st_mode)){
+ if(S_ISBLK(lst->st_mode)){
if((fd = open(name, O_RDONLY)) >= 0){
d->length = disksize(fd, st);
close(fd);