From 3d72637f9b4c42b1fc9b7d95d278ea3dd65c748d Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 26 Apr 2004 19:28:28 +0000 Subject: [PATCH] Don't be stupid. --- src/lib9/_p9dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c index 18e899b6..83f35602 100644 --- a/src/lib9/_p9dir.c +++ b/src/lib9/_p9dir.c @@ -176,7 +176,7 @@ _p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr) /* fetch real size for disks */ #ifdef _HAVEDISKSIZE - if((fd = open(name, O_RDONLY)) >= 0){ + if(S_ISBLK(st->st_mode) && (fd = open(name, O_RDONLY)) >= 0){ d->length = disksize(fd, major(st->st_dev)); close(fd); }