summaryrefslogtreecommitdiffstats
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
parent393a861dbd9cc9f243efae043b852bb2e736afd0 (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.
-rw-r--r--cpukit/ChangeLog7
-rw-r--r--cpukit/posix/src/psignal.c20
2 files changed, 19 insertions, 8 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 0992288c24..9d65ac5c6f 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,12 @@
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.
+
+2008-06-05 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* libcsupport/src/newlibc_exit.c: Only run the fini section on exit if
the target toolset uses init/fini sections.
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 );
+ }
}