Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3. #include <libc/file.h>
  4. #include <libc/local.h>
  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. {
  15.   _fwalk(fcloseall_helper);
  16. }
  17.  
  18. void (*__stdio_cleanup_hook)(void) = __stdio_cleanup_proc;
  19.