Changeset 4c5080ed in rtems


Ignore:
Timestamp:
May 11, 1999, 4:30:51 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
123d4b7d
Parents:
ddd22e5
Message:

Fix based on bug report from Jay Kulpinski <jskulpin@…>
that the per task reentrancy structure was not being processed properly
during exit().

joel@… wrote:

This is always an ugly place to poke around. :(

The code in newlib/libc/stdlib/exit.c walks the atexit chain for the
reentrancy structure for JUST the current task. The code in libc_wrapup()
does it for both the current task and the global reentrancy structure
(which tends to be where driver atexit()'s were registered.

So I think the _wrapup_reent(0) in libc_wrapup() should be commented out.

If you concur, then I will make the change and improve the comment on this
line of code to explain things:

libc_wrapup(); /* Why? XXX */

--joel

That does the job. cdtest.exe works correctly now.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/newlibc.c

    rddd22e5 r4c5080ed  
    8585       return;
    8686
     87    /*
     88     *  This was already done if the user called exit() directly .
     89
    8790    _wrapup_reent(0);
     91     */
    8892    if (_REENT != &libc_global_reent)
    8993    {
     
    364368void _exit(int status)
    365369{
    366     libc_wrapup(); /* Why? XXX */
     370    /*
     371     *  We need to do the exit processing on the global reentrancy structure.
     372     *  This has already been done on the per task reentrancy structure
     373     *  associated with this task.
     374     */
     375
     376    libc_wrapup();
    367377    rtems_shutdown_executive(status);
    368378}
  • c/src/lib/libc/newlibc.c

    rddd22e5 r4c5080ed  
    8585       return;
    8686
     87    /*
     88     *  This was already done if the user called exit() directly .
     89
    8790    _wrapup_reent(0);
     91     */
    8892    if (_REENT != &libc_global_reent)
    8993    {
     
    364368void _exit(int status)
    365369{
    366     libc_wrapup(); /* Why? XXX */
     370    /*
     371     *  We need to do the exit processing on the global reentrancy structure.
     372     *  This has already been done on the per task reentrancy structure
     373     *  associated with this task.
     374     */
     375
     376    libc_wrapup();
    367377    rtems_shutdown_executive(status);
    368378}
  • cpukit/libcsupport/src/newlibc.c

    rddd22e5 r4c5080ed  
    8585       return;
    8686
     87    /*
     88     *  This was already done if the user called exit() directly .
     89
    8790    _wrapup_reent(0);
     91     */
    8892    if (_REENT != &libc_global_reent)
    8993    {
     
    364368void _exit(int status)
    365369{
    366     libc_wrapup(); /* Why? XXX */
     370    /*
     371     *  We need to do the exit processing on the global reentrancy structure.
     372     *  This has already been done on the per task reentrancy structure
     373     *  associated with this task.
     374     */
     375
     376    libc_wrapup();
    367377    rtems_shutdown_executive(status);
    368378}
Note: See TracChangeset for help on using the changeset viewer.