17 lines
276 B
C
17 lines
276 B
C
|
|
#include <stdio.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
#include <__fio.h>
|
||
|
|
|
||
|
|
FILE *freopen(const char *path, const char *mode, FILE *fp)
|
||
|
|
{
|
||
|
|
int res = __fio_fclose(fp);
|
||
|
|
|
||
|
|
res = __fio_fopen(path, mode, fp);
|
||
|
|
if (res != 0) {
|
||
|
|
free(fp);
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
|
||
|
|
return fp;
|
||
|
|
}
|