shithub: scc

ref: 6ed60e4e77c4c59fdd0aa27fb6b9af2be9658faf
dir: /lib/c/freopen.c/

View raw version

#include <stdio.h>

#include "syscall.h"
#undef freopen

FILE *
freopen(const char * restrict name, const char * restrict mode,
        FILE * restrict fp)
{
	if (fclose(fp) == EOF)
		return NULL;
	return _fpopen(name, mode, fp);
}