openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/libmisc/cleanup.c
void do_cleanups(void)
{
    unsigned int i;

    /* Make sure there were no overflow */
    assert(NULL == cleanup_functions[CLEANUP_FUNCTIONS - 1]);

    if (getpid() != cleanup_pid)
    {
        return;
    }

    i = CLEANUP_FUNCTIONS;
    do
    {
        i--;
        if (cleanup_functions[i] != NULL)
        {
            cleanup_functions[i](cleanup_function_args[i]);
        }
    } while (i > 0);
}
/*
 * do_cleanups - perform the actions stored in the cleanup_functions stack.
 *
 * Cleanup action are not executed on exit of the processes started by the
 * parent (first caller of add_cleanup).
 *
 * It is intended to be used as:
 *     atexit (do_cleanups);
 */
perform the actions stored in the cleanup_functions stack.
Cleanup action are not executed on exit of the processes started by the
parent (first caller of add_cleanup).

It is intended to be used as:
atexit (do_cleanups).
perform the actions stored in the cleanup_functions stack . Cleanup action are not executed on exit of the processes started by the parent ( first caller of add_cleanup ) . It is intended to be used as : atexit ( do_cleanups ) .
void do_cleanups(void)
{
    unsigned int i;
    assert(NULL == cleanup_functions[CLEANUP_FUNCTIONS - 1]);
    if (getpid() != cleanup_pid)
    {
        return;
    }
    i = CLEANUP_FUNCTIONS;
    do
    {
        i--;
        if (cleanup_functions[i] != NULL)
        {
            cleanup_functions[i](cleanup_function_args[i]);
        }
    } while (i > 0);
}
void do_cleanups ( void ) { unsigned int i ; assert ( NULL == cleanup_functions [ CLEANUP_FUNCTIONS - 1 ] ) ; if ( getpid ( ) != cleanup_pid ) { return ; } i = CLEANUP_FUNCTIONS ; do { i -- ; if ( cleanup_functions [ i ] != NULL ) { cleanup_functions [ i ] ( cleanup_function_args [ i ] ) ; } } while ( i > 0 ) ; }
do_cleanups - perform the actions stored in the cleanup_functions stack.
do_cleanups - perform the actions stored in the cleanup_functions stack .
/* Make sure there were no overflow */