shithub: riscv

ref: 1a73b594e684623c9ea1b72141f4e70ee913740b
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;
	}
}