:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / crtdll / stdio / stdiohk.c
1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
2 #include <crtdll/stdio.h>
3 #include <crtdll/internal/file.h>
4
5
6 static void fcloseall_helper(FILE *f)
7 {
8   fflush(f);
9   if (fileno(f) > 2)
10     fclose(f);
11 }
12
13 void __stdio_cleanup_proc(void);
14 void __stdio_cleanup_proc(void)
15 {
16   _fwalk(fcloseall_helper);
17 }
18
19 void (*__stdio_cleanup_hook)(void) = __stdio_cleanup_proc;