Skip to content

Commit

Permalink
Fix nasa#382, Replace exit(1) and exit(-1) with EXIT_FAILURE macro
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Dec 11, 2023
1 parent 71ee927 commit 6ccf27b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fsw/mcp750-vxworks/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void CFE_PSP_Restart(uint32 reset_type)
void CFE_PSP_Panic(int32 ErrorCode)
{
printf("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode);
exit(-1); /* Need to improve this */
exit(EXIT_FAILURE);
}

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion fsw/pc-linux/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void CFE_PSP_DisplayUsage(char *Name)
printf(" %s --reset PO --subtype 1 --cpuid 1 --cpuname CPU1 --scid 32\n", Name);
printf(" \n");

exit(1);
exit(EXIT_FAILURE);
}

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion fsw/pc-linux/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void CFE_PSP_Panic(int32 ErrorCode)
{
OS_printf("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode);
OS_printf("The cFE could not start.\n");
abort(); /* abort() is preferable to exit(-1), as it may create a core file for debug */
abort(); /* abort() is preferable to exit(EXIT_FAILURE), as it may create a core file for debug */
}

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion fsw/pc-rtems/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void CFE_PSP_Restart(uint32 reset_type)
{
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
OS_printf("CFE_PSP_Restart is not implemented on this platform ( yet ! )\n");
exit(-1);
exit(EXIT_FAILURE);
}

/******************************************************************************
Expand Down

0 comments on commit 6ccf27b

Please sign in to comment.