[PATCH 5/5] posix: Avoid fatal error in Shm object create

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 9 07:10:48 UTC 2019


---
 cpukit/posix/src/shmwkspace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cpukit/posix/src/shmwkspace.c b/cpukit/posix/src/shmwkspace.c
index 94456e2c5c..038edc51d1 100644
--- a/cpukit/posix/src/shmwkspace.c
+++ b/cpukit/posix/src/shmwkspace.c
@@ -24,7 +24,11 @@ int _POSIX_Shm_Object_create_from_workspace(
   size_t size
 )
 {
-  shm_obj->handle = _Workspace_Allocate_or_fatal_error( size );
+  shm_obj->handle = _Workspace_Allocate( size );
+  if ( shm_obj->handle == NULL ) {
+    return ENOMEM;
+  }
+
   memset( shm_obj->handle, 0, size );
   shm_obj->size = size;
   return 0;
-- 
2.16.4




More information about the devel mailing list