ref: 848e5ed619c6e3c58f3b4f5c12beace6c8fd4209
dir: /lib/c/freopen.c/
#include <stdio.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);
}