mirror of https://github.com/flysand7/ciabatta.git
stdio.h: fclose
This commit is contained in:
parent
aa3073904d
commit
c96362fb83
|
@ -239,6 +239,15 @@ FILE *tmpfile(void) {
|
|||
}
|
||||
|
||||
int fclose(FILE *stream) {
|
||||
if(fflush(stream) == EOF) {
|
||||
return EOF;
|
||||
}
|
||||
if(stream->buffer.is_internal) {
|
||||
free(stream->buffer.data);
|
||||
}
|
||||
if(!CloseHandle(stream->handle)) {
|
||||
return EOF;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue