Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature-vt/sys/src/libstdio/fclose.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * pANS stdio -- fclose
3
 */
4
#include "iolib.h"
5
int fclose(FILE *f){
6
	int error=0;
7
	if(f->state==CLOSED) return EOF;
8
	if(fflush(f)==EOF) error=EOF;
9
	if(f->flags&BALLOC) free(f->buf);
10
	if(!(f->flags&STRING) && close(f->fd)<0) error=EOF;
11
	f->state=CLOSED;
12
	f->flags=0;
13
	return error;
14
}