shithub: riscv

ref: 5030157da9e89da53739b13c36942a5355de669f
dir: /sys/src/libstdio/clearerr.c/

View raw version
/*
 * pANS stdio -- clearerr
 */
#include "iolib.h"
void clearerr(FILE *f){
	switch(f->state){
	case ERR:
		f->state=f->buf?RDWR:OPEN;
		break;
	case END:
		f->state=RDWR;
		break;
	}
}