aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-10-29 17:37:10 +0000
committerrsc <devnull@localhost>2005-10-29 17:37:10 +0000
commit286237e092acc24d7336bcb8ac45ee9c41e8042a (patch)
tree106b2a6abf1dc1156dcf2fd7009fb4092474173a /src/cmd/9p.c
parent58c524094e93cc868e908eb3b8cbd5a2453949d3 (diff)
downloadplan9port-286237e092acc24d7336bcb8ac45ee9c41e8042a.tar.gz
plan9port-286237e092acc24d7336bcb8ac45ee9c41e8042a.tar.bz2
plan9port-286237e092acc24d7336bcb8ac45ee9c41e8042a.zip
Add close.
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 99033bc8..2570aa3e 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -151,6 +151,7 @@ xread(int argc, char **argv)
fid = xopen(argv[0], OREAD);
while((n = fsread(fid, buf, sizeof buf)) > 0)
write(1, buf, n);
+ fsclose(fid);
if(n < 0)
sysfatal("read error: %r");
threadexitsall(0);
@@ -229,6 +230,7 @@ xwrite(int argc, char **argv)
}
if(n < 0)
sysfatal("read error: %r");
+ fsclose(fid);
threadexitsall(0);
}
@@ -312,6 +314,7 @@ xrdwr(int argc, char **argv)
if(fswrite(fid, buf, n) != n)
fprint(2, "write: %r\n");
}
+ fsclose(fid);
threadexitsall(0);
}