Add close.

This commit is contained in:
rsc 2005-10-29 17:37:10 +00:00
parent 58c524094e
commit 286237e092

View file

@ -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);
}