From bdb66433031ca96f2fd127995186623cd10c45b3 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Mon, 14 Aug 2006 14:13:52 +0000 Subject: set size for directories correctly in wdir and mkfs mkdir ls shows stat info for each dir entry --- fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs.c') diff --git a/fs.c b/fs.c index cf717a2..2370e0e 100644 --- a/fs.c +++ b/fs.c @@ -355,7 +355,8 @@ writei(struct inode *ip, char *addr, uint off, uint n) } if (r > 0) { if (off > ip->size) { - ip->size = off; + if (ip->type == T_DIR) ip->size = ((off / BSIZE) + 1) * BSIZE; + else ip->size = off; } iupdate(ip); } -- cgit v1.2.3