Skip to content

Commit

Permalink
Make use of perror
Browse files Browse the repository at this point in the history
  • Loading branch information
pavll committed Sep 21, 2021
1 parent 34b5b90 commit 879ea05
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions fsw/pc-linux/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void CFE_PSP_InitCDS(void)
*/
if ((key = ftok(CFE_PSP_CDS_KEY_FILE, 'R')) == -1)
{
OS_printf("CFE_PSP: Cannot Create CDS Shared memory key!\n");
perror("CFE_PSP - Cannot Create CDS Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -151,7 +151,7 @@ void CFE_PSP_InitCDS(void)
*/
if ((CDSShmId = shmget(key, CFE_PSP_CDS_SIZE, 0644 | IPC_CREAT)) == -1)
{
OS_printf("CFE_PSP: Cannot shmget CDS Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmget CDS Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -161,7 +161,7 @@ void CFE_PSP_InitCDS(void)
CFE_PSP_ReservedMemoryMap.CDSMemory.BlockPtr = shmat(CDSShmId, (void *)0, 0);
if (CFE_PSP_ReservedMemoryMap.CDSMemory.BlockPtr == (void *)(-1))
{
OS_printf("CFE_PSP: Cannot shmat to CDS Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmat to CDS Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand Down Expand Up @@ -346,7 +346,7 @@ void CFE_PSP_InitResetArea(void)
*/
if ((key = ftok(CFE_PSP_RESET_KEY_FILE, 'R')) == -1)
{
OS_printf("CFE_PSP: Cannot Create Reset Area Shared memory key!\n");
perror("CFE_PSP - Cannot Create Reset Area Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -368,7 +368,7 @@ void CFE_PSP_InitResetArea(void)
*/
if ((ResetAreaShmId = shmget(key, total_size, 0644 | IPC_CREAT)) == -1)
{
OS_printf("CFE_PSP: Cannot shmget Reset Area Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmget Reset Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -378,7 +378,7 @@ void CFE_PSP_InitResetArea(void)
block_addr = (cpuaddr)shmat(ResetAreaShmId, (void *)0, 0);
if (block_addr == (cpuaddr)(-1))
{
OS_printf("CFE_PSP: Cannot shmat to Reset Area Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmat to Reset Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand Down Expand Up @@ -484,7 +484,7 @@ void CFE_PSP_InitUserReservedArea(void)
*/
if ((key = ftok(CFE_PSP_RESERVED_KEY_FILE, 'R')) == -1)
{
OS_printf("CFE_PSP: Cannot Create User Reserved Area Shared memory key!\n");
perror("CFE_PSP - Cannot Create User Reserved Area Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -493,7 +493,7 @@ void CFE_PSP_InitUserReservedArea(void)
*/
if ((UserShmId = shmget(key, CFE_PSP_USER_RESERVED_SIZE, 0644 | IPC_CREAT)) == -1)
{
OS_printf("CFE_PSP: Cannot shmget User Reserved Area Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmget User Reserved Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand All @@ -503,7 +503,7 @@ void CFE_PSP_InitUserReservedArea(void)
CFE_PSP_ReservedMemoryMap.UserReservedMemory.BlockPtr = shmat(UserShmId, (void *)0, 0);
if (CFE_PSP_ReservedMemoryMap.UserReservedMemory.BlockPtr == (void *)(-1))
{
OS_printf("CFE_PSP: Cannot shmat to User Reserved Area Shared memory Segment!\n");
perror("CFE_PSP - Cannot shmat to User Reserved Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

Expand Down

0 comments on commit 879ea05

Please sign in to comment.