posix: Avoid fatal error in Shm object create

This commit is contained in:
Sebastian Huber
2019-04-06 14:30:05 +02:00
parent 1bf2f160e2
commit 8aaa055adb

View File

@@ -24,7 +24,11 @@ int _POSIX_Shm_Object_create_from_workspace(
size_t size 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 ); memset( shm_obj->handle, 0, size );
shm_obj->size = size; shm_obj->size = size;
return 0; return 0;