summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/psignal.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-05 14:36:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-05 14:36:11 +0000
commitc7fae600919091fcdb08219aef5066549e8dbc51 (patch)
tree243aa89ea8e99b8166f033ee9705abb3fb97c6ab /cpukit/posix/src/psignal.c
parent2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-c7fae600919091fcdb08219aef5066549e8dbc51.tar.bz2
2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* 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.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/src/psignal.c20
1 files changed, 12 insertions, 8 deletions
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 );
+ }
}