mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
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.
This commit is contained in:
parent
6c17f63090
commit
3a62e56307
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue