Skip to content

Commit

Permalink
Fix #299, Sleep before exit when printing
Browse files Browse the repository at this point in the history
  • Loading branch information
pavll committed Sep 22, 2021
1 parent 1bd7bd9 commit bf9b935
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions fsw/pc-linux/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot Create CDS Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
** connect to (and possibly create) the segment:
*/
if ((CDSShmId = shmget(key, CFE_PSP_CDS_SIZE, 0644 | IPC_CREAT)) == -1)
{
OS_printf("CFE_PSP: Cannot shmget CDS Shared memory Segment!\n");
exit(-1);
perror("CFE_PSP - Cannot shmget CDS Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
Expand All @@ -161,8 +161,8 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot shmat to CDS Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

CFE_PSP_ReservedMemoryMap.CDSMemory.BlockSize = CFE_PSP_CDS_SIZE;
Expand Down Expand Up @@ -346,8 +346,8 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot Create Reset Area Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
Expand All @@ -368,8 +368,8 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot shmget Reset Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
Expand All @@ -378,8 +378,8 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot shmat to Reset Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

FixedBlocksPtr = (CFE_PSP_LinuxReservedAreaFixedLayout_t *)block_addr;
Expand Down Expand Up @@ -484,17 +484,17 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot Create User Reserved Area Shared memory key");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
** connect to (and possibly create) the segment:
*/
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");
exit(-1);
perror("CFE_PSP - Cannot shmget User Reserved Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

/*
Expand All @@ -503,8 +503,8 @@ 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");
exit(-1);
perror("CFE_PSP - Cannot shmat to User Reserved Area Shared memory Segment");
CFE_PSP_Panic(CFE_PSP_ERROR);
}

CFE_PSP_ReservedMemoryMap.UserReservedMemory.BlockSize = CFE_PSP_USER_RESERVED_SIZE;
Expand Down

0 comments on commit bf9b935

Please sign in to comment.