From c7fae600919091fcdb08219aef5066549e8dbc51 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 5 Jun 2008 14:36:11 +0000 Subject: 2008-06-05 Joel Sherrill * posix/src/psignal.c: Do not allocate any memory for queued signals if the configuration parameter is 0. Before we would end up with an allocation of 0 which rounded up and wasted some memory when POSIX was configured. --- cpukit/ChangeLog | 7 +++++++ cpukit/posix/src/psignal.c | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 0992288c24..9d65ac5c6f 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2008-06-05 Joel Sherrill + + * posix/src/psignal.c: Do not allocate any memory for queued signals if + the configuration parameter is 0. Before we would end up with an + allocation of 0 which rounded up and wasted some memory when POSIX + was configured. + 2008-06-05 Joel Sherrill * libcsupport/src/newlibc_exit.c: Only run the fini section on exit if diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 70642cff09..493b315d39 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -205,12 +205,16 @@ void _POSIX_signals_Manager_Initialization( for ( signo=1 ; signo<= SIGRTMAX ; signo++ ) _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] ); - _Chain_Initialize( - &_POSIX_signals_Inactive_siginfo, - _Workspace_Allocate_or_fatal_error( - maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node ) - ), - maximum_queued_signals, - sizeof( POSIX_signals_Siginfo_node ) - ); + if ( maximum_queued_signals ) { + _Chain_Initialize( + &_POSIX_signals_Inactive_siginfo, + _Workspace_Allocate_or_fatal_error( + maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node ) + ), + maximum_queued_signals, + sizeof( POSIX_signals_Siginfo_node ) + ); + } else { + _Chain_Initialize_empty( &_POSIX_signals_Inactive_siginfo ); + } } -- cgit v1.2.3