Skip to content

Commit

Permalink
Merge pull request nasa#383 from thnkslprpt/fix-382-replace-exit-1-wi…
Browse files Browse the repository at this point in the history
…th-exit-failure

Fix nasa#382, Replace exit(1) and exit(-1) with EXIT_FAILURE macro
  • Loading branch information
dmknutsen authored Dec 15, 2023
2 parents 4ca6c91 + 532b354 commit f27c73e
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 @@ -102,7 +102,7 @@ void CFE_PSP_Restart(uint32 reset_type)
void CFE_PSP_Panic(int32 ErrorCode)
{
printf("%s called with error code = 0x%08X. Exiting.\n", __func__, (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 @@ -117,7 +117,7 @@ void CFE_PSP_Panic(int32 ErrorCode)
{
OS_printf("%s called with error code = 0x%08X. Exiting.\n", __func__, (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 @@ -75,7 +75,7 @@ void CFE_PSP_Restart(uint32 reset_type)
{
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
OS_printf("%s is not implemented on this platform ( yet ! )\n", __func__);
exit(-1);
exit(EXIT_FAILURE);
}

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

0 comments on commit f27c73e

Please sign in to comment.