Changeset b7cf1ff7 in rtems


Ignore:
Timestamp:
Apr 24, 2013, 1:04:30 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
f22bba3
Parents:
5fa0e5c5
git-author:
Sebastian Huber <sebastian.huber@…> (04/24/13 13:04:30)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/26/13 08:57:08)
Message:

libcsupport: Delete libc_wrapup()

Add and use rtems_libio_exit_helper. Add rtems_libio_exit().

The fclose(stdin) etc. makes no sense during exit. This would use the
_REENT structure of the thread calling _exit().

Location:
cpukit
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/Makefile.am

    r5fa0e5c5 rb7cf1ff7  
    5757    src/privateenv.c \
    5858    src/libio_helper_null.c \
     59    src/libio_exit.c \
    5960    src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
    6061
  • cpukit/libcsupport/include/rtems/libio.h

    r5fa0e5c5 rb7cf1ff7  
    13931393extern const rtems_libio_helper rtems_libio_post_driver_helper;
    13941394
     1395extern const rtems_libio_helper rtems_libio_exit_helper;
     1396
    13951397extern const rtems_libio_helper rtems_fs_init_helper;
    13961398
     
    13981400
    13991401void rtems_libio_post_driver(void);
     1402
     1403void rtems_libio_exit(void);
    14001404
    14011405/**
  • cpukit/libcsupport/src/newlibc_exit.c

    r5fa0e5c5 rb7cf1ff7  
    1212#endif
    1313
    14 #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
    1514#include <rtems.h>
    1615
    1716#if defined(RTEMS_NEWLIB)
    18 #include <rtems/libcsupport.h>
     17#include <rtems/libio.h>
    1918
    2019#include <stdio.h>
    2120#include <unistd.h>
    22 
    23 static void libc_wrapup(void)
    24 {
    25   /*
    26    *  In case RTEMS is already down, don't do this.  It could be
    27    *  dangerous.
    28    */
    29 
    30   if (!_System_state_Is_up(_System_state_Get()))
    31      return;
    32 
    33   /*
    34    * Try to drain output buffers.
    35    *
    36    * Should this be changed to do *all* file streams?
    37    *    _fwalk (_REENT, fclose);
    38    */
    39 
    40   fclose (stdin);
    41   fclose (stdout);
    42   fclose (stderr);
    43 }
    4421
    4522/* FIXME: These defines are a blatant hack */
     
    6744  #endif
    6845
    69   libc_wrapup();
     46  (*rtems_libio_exit_helper)();
    7047  rtems_shutdown_executive(status);
    7148  for (;;) ; /* to avoid warnings */
  • cpukit/sapi/include/confdefs.h

    r5fa0e5c5 rb7cf1ff7  
    105105  #else
    106106    rtems_libio_post_driver;
     107  #endif
     108
     109const rtems_libio_helper rtems_libio_exit_helper =
     110  #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     111    rtems_libio_helper_null;
     112  #else
     113    rtems_libio_exit;
    107114  #endif
    108115
Note: See TracChangeset for help on using the changeset viewer.