[rtems commit] posix: Avoid fatal error in Shm object create
Sebastian Huber
sebh at rtems.org
Wed Apr 10 07:50:25 UTC 2019
Module: rtems
Branch: master
Commit: 8aaa055adb28a85461d2847c4d2c7de3f25c2229
Changeset: http://git.rtems.org/rtems/commit/?id=8aaa055adb28a85461d2847c4d2c7de3f25c2229
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Sat Apr 6 14:30:05 2019 +0200
posix: Avoid fatal error in Shm object create
---
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 94456e2..038edc5 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;
More information about the vc
mailing list