sam: report close error

This commit is contained in:
Russ Cox 2019-12-19 15:00:58 -05:00
parent 0b349f6f34
commit a1ead676e6
3 changed files with 9 additions and 1 deletions

View file

@ -166,7 +166,7 @@ writeio(File *f)
void
closeio(Posn p)
{
close(io);
Close(io);
io = 0;
if(p >= 0)
dprint("#%lud\n", p);

View file

@ -237,6 +237,7 @@ int Read(int, void*, int);
void Seek(int, long, int);
int plan9(File*, int, String*, int);
int Write(int, void*, int);
void Close(int);
int bexecute(File*, Posn);
void cd(String*);
void closefiles(File*, String*);

View file

@ -58,3 +58,10 @@ Seek(int f, long n, int w)
if(seek(f, n, w)==-1)
syserror("seek");
}
void
Close(int f)
{
if(close(f) < 0)
syserror("close");
}