shithub: scc

ref: 53acc44c82ab004ac565970c3f8f4d80894ed761
dir: /lib/c/freopen.c/

View raw version

#include <stdio.h>

#include "syscall.h"
#include "libc.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);
}