summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-08-14 14:13:52 +0000
committerkaashoek <kaashoek>2006-08-14 14:13:52 +0000
commitbdb66433031ca96f2fd127995186623cd10c45b3 (patch)
tree037ffd2021f27718fba32c27cacd9ca52682b613 /ulib.c
parentd15f0d1033a7da6448966d9626ec2776781e4188 (diff)
downloadxv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.gz
xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.bz2
xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.zip
set size for directories correctly in wdir and mkfs
mkdir ls shows stat info for each dir entry
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ulib.c b/ulib.c
index eaa33d3..004b934 100644
--- a/ulib.c
+++ b/ulib.c
@@ -61,11 +61,11 @@ gets(char *buf, int max)
int
stat(char *n, struct stat *st)
{
- int fd = open(n, O_RDONLY);
+ int fd;
int r;
+ fd = open(n, O_RDONLY);
if (fd < 0) return -1;
-
r = fstat(fd, st);
close(fd);
return r;